Added chat functionality to server and client