Fix API reference

The recent refactor broke the API docs.  This fixes them.

Based on #360 and #361.