Added checks for errorCallback and its existence before calling it.
Added examples for errorCallbacks and customHeaders