[Enhanced] API improved controller.js