API in controller