implemented basic communication with client