Added register, login and logout functionality