rename valid api to validate