Added login, registration and logout functionality