Setup login and logout and added new functions