add toJson method