refactoring of the routes and adding a test shell script