fixed basic auth headers on JS api

Explictly set basic Auth headers as these are sometimes not set automatically