Resolve "HTTP status codes"
This MR adds the 404 and 500 status codes to the REST interfaces where applicable.
It also fixes a circular dependency between tokenize and commons and includes minor improvements where I stumbled upon things to refactor.
Closes #251 (closed)
Edited by Michelle Weidling