moved xhr to new file