Added api_key option to login