added register, login and logout functionality