fix: FromJSON, ToJSON (complete rewrite after i found a bug)