Split success and error callbacks and expose synchronous request method in public api
Exit send or receive loops after exception