Rework routing

Reworked the routing. See https://github.com/owncloud/tasks/issues/58