Empty out the StringWriter to cater for new messages from Server
Call different functions depending on request parameters