refractored client connections
added http basic authentication