adding / modifiying more code to get the api key to work