JSONifying the messages. Incomplete state: update at own risk
Adding types for future JSONification