Cleaned unused code and added function in 'protocol.c' module to extract data field from the buffer received from server. Only the protocol should know the indexes of data field and size.