Add start of API

Bit of a mess but has:

1. An API
2. A roundtrip test

We definitely need to improve the API. The main advantage is that this one exists.