added functionality for external api keys