Move all API-related gubbins to the generator... no need elsewhere