Update XHR code to handle arraybuffer responseType