adding validate api