fix class name for the api routes and fix file generation