Adding Generic To/FromJSON instances for json and rest-json services