Adding initial API functionality

Rough sketch to be fleshed out later when I have time to clean up my working tree and post it