Refactor API

Route definitions are clearer.