Update api code
Merge pull request #40 from mojotech/cg/api

Update api code