Added logout, login token expiration is time()+10 hours, refactor