Refactored API calls