Implements login api call