added environment variables to API calls