server connection implemetation