- indentation fixes
- events JSON is printed when there are errors
- give an error if the type is not supported
- more exception handling when wrong data is received