Added better handling of errors when doing callback.
Added usage of WebMock in test framework.