[Build] Code cleanup of the API generator.