Fixing error handling in XHR requests

- Fixing reference errors in `client` methods
- Fixes #35