this is not necessary if you set xhr.responseType = 'json'