Refactored API access