added rules API (#4)