On error callback

Here it is just so I didn't throw it away.  You wont hurt my feelings if you don't take the on_error stuff, but the spec stuff might be nice to promote more specs.

The only weird thins is that I added call_api() function to support mocking. See how I use it in rest_connection_spec.rb

-CP