added dynamic routing, updated the docs and fixed the example