Refactor login and register code

1. Abandoned try catch statement and use axios promise chains for handling the errors.
Avoided duplicated error handling logic for the same action
2. Removed unneeded useEffect in the input components
3. Refactor some code in the input components for better readability

Change-Id: I420ce4025a00cb842c743cb001983338d0359f46
diff --git a/server/src/routers/nameserver-router.ts b/server/src/routers/nameserver-router.ts
index 415c2d1..e0f27e9 100644
--- a/server/src/routers/nameserver-router.ts
+++ b/server/src/routers/nameserver-router.ts
@@ -35,7 +35,7 @@
     const result = await jamid.lookupUsername(req.params.username, res.locals.accountId);
     switch (result.state) {
       case RegisteredNameFoundState.Found:
-        res.send(result);
+        res.status(HttpStatusCode.Ok).send(result);
         break;
       case RegisteredNameFoundState.InvalidResponse:
         res.status(HttpStatusCode.BadRequest).send('Invalid username');