Test for presence of AJAX

Ran into a weird issue when I was creating Response instances manually and this through an error.