Local api

A few bits are less than ideal, but it gets the job done.