Added code to talk to server