cleaning up generator code for an api

@darbyfrey