Fork API types.

All tests pass (for now...)  Rebasing this PR is a _pain_
I'm OK with this horrific switch only if it comes with a TODO to convert everything in here into a function in your already created maps. :)