Ensure trailing backslash, make the APIs endpoints more dynamic, and fixed overall order and priority of rules.