Error block

When a call to Resource.create(attributes) fails, we were returning nil without access to any error messages.

Adding ability to pass a block to the create method which yields the response object.

Also, abstracting some of the error checking code and adding failure tests