Updated the api route generation