make a controller for api