Fix issue #12. Add a failure callback to save API call

#12