starting apiKey function