Refactors API.
Merge pull request #62 from jmeas/api-cleanup

Api cleanup