added check for existing api keys