deriveJSON does not work very well for enums, so now generating FromJSON and ToJSON instances