updated api to use regex on required fields