add rules route update functionality

added direction for update route and ability to rewrite rules pattern
plus wipe previous rules pattern