fix conditional to check for api keys