move JSON serialization into model
pretify json dump output
dump and insert updated to use same format and tested