allow toJSON recursive to be an option