added basic auth to restclient. misc changes