Add API doc to the validate function