Update rules engine and v2 api