Add replacer to JSON.stringify

Add function to remove unnecessary field ('deferred') from the message, that will be send to the server