add basic JSON serialization. based on eleddys work: https://github.com/eleddy/puget.batshitcrazy