[REST] refactored rest responses to Either RESTError a

This way we can have a handle of the errors in the high-level
components. Before they were implicitly discarded.
Status Job ID Name Coverage
failed #1840

Name Stage Failure
test Test There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job trace