implementing serialization stuff

see #74
there might be some insanity involved related to enums…
simplified the json structure

see #74