Is there are way to add a custom header in JS API?

Moderator, please remove this question. The problem was solved by just simply appending a correct query parameter. Thank you.