Use xhr instead of native http object