Client side code to receiv data from server