Added error checking to throw an exception on non-OK response code