first commit, much of the api work done