Implemented connection to server