how to store and use API key stored as environment variable