add register, login and logout logic