Adding API to controllers