added API to set xhr object from host