added documentation and functionality to routes