add toJSON methods