Change some functions to return XMLHTTPRequest