Updated API controller