add criteria api functional.