Added register and login functionality