changed basic auth to apikey auth, misc fixes