add more meaningful errors to failed REST requests. fixes #14