Properly save error from curl and actually call the failure() callback