Changed loading api key from environment rather than from object