Add the basic toJson function