Add API to set the data that is sent to the server.