Update api docs.
Add error handling to examples.