Fixed response type error in XMLHttpRequest