Add macros that generates from_json and to_json for rest