added registration, login and logout functionality