Refactoring API Calls