Client: Raise error for failures

- refactored spec/client_spec.rb to add failure cases.