Don't call toJSON if the method does not exist