added RestError for a bit better handling