receiving the api key on constructor