adding check to see if the api key is present