Initial API structure

This is the early work on the api.  The general structure is set up, but there are still a few more interfaces that have to be written.