Updated api controller