Refactoring to allow for additional environments

Core code changes are mostly to setup for future enhancements and cleaning up to ensure usage of the json configuration for API keys and API locations.