If the hash chain element is corrupted, the server ignores the request. However, if some intruder corrupts the word in transit, the server will charge the client for a word which the client was not interested in. Hence, to preserve the integrity of the message you need to append a MAC to it. The MAC can be generated using the session-key exchanged between the server and client during session startup. All communication is encrypted using the session key.
Client sends a word to spellcheck to the server.
When the client runs out of tokens of a specific denomination, it needs to exchange tokens of different denomination. There are three steps to making the source code changes you need to make. You have considerable freedom in this matter. You may reuse your code from the first programming assignment. Having decided what schemes you will use, the next step will be to fix the details of the protocols.