Added register/login/logout functionality