Fix: Non-positiv integers are allwed as error code
Move error reporting to http status codes