added basic auth and other changes