If API call fails, possibility to provide an onError callback
Callback functions now take both error & result

This simplify the API (only one function to provide)
and allow easy transformation into promises & Cie.

Reported-by: phsiao2000
Signed-off-by: Étienne Vallette d'Osia <evo@zenexity.com>
Proper error callback on submit + docs + tests
Merge pull request #16 from rudyrigot/error_callback

If API call fails, possibility to provide an onError callback