Api cleanup

Fixes #41, #61 (to some extent) and #96