Adding login method to the api