Update API documentation. Fixes #502