implemented basic communication with server