Added API documentation.

Fixes #397.