Changed the message format to JSON. Added the ability to save files