Implement the login and signup API.