modified loading procedure for api keys