Implemented user registration and login