Implemented the endpoint to generate the code.