implemented the server part for total iteration.