added support for rules in JSON