added register and login functionality