Added code to login using api key.