added support for api keys