Source: API.js

/**
 * Pre process a rest call.
 * @param {XMLHttpRequest} xhr
 * @param {*} data
 */
function hook_rest_pre_process(xhr, data) {
  // Do stuff before the rest call...
}

/**
 * Post process a rest call.
 * @param {XMLHttpRequest} xhr
 */
function hook_rest_post_process(xhr) {
  // Do stuff after the rest call...
}