Add basic error handling.

Don't return empty_response on a PUT failure, return an error tuple and throw a request error. @reiddraper