login and register methods return json with user information