moved api call to Controller.php