Added success and error cases for login