fix relative route in js, add request headers support