Better API

Closes #1.