implement generic rule API class