Implement register and login functionality