added basic auth to api endpoint