Add login method to API.