Document exported API.
Add better error checking.
Add user documentation.