modify api to change validation to rulesets. also add error callbacks.