fix security group rule bugs. add some helper methods to Router