refactoring some of teh API calls and setting env variables for API key