Initial pass at a good XHR block; works but needs headers