Document new API.
Update code to the new public API.
Update sample code to use new API.