Set status for endpoints when an error occours

With this PR  status for endpoints is set when an error accour's like mentioned in #697.
So a ErrorFormatter can use the status.