Change some functions to return the XMLHTTPRequest