Update the documentation.

* Take into account the latest changes in the API.
* Update code examples.