Making xhr async