to retrieve data according to the query sent to server.