Refactored API controllers