use separate function for setting route parameters
Updated tests