Breaking the API calls and caching into a separate file.