WIP: beginnings of an API wrapper, tons of work left to do.
fix merge