added unit tests and error handling for login
added error handling for update profile