implements basic auth scheme to API