save_api_key function

Saves the API key for future functions