Add api code with some examples.
Make ready for upload to github.