modified validate api route