Implement promises on login() and logout() functions in service