spec basic route parsing and matching and fix some bugs