implement toJSON for native DataTypes