Cleaned up API controller