generalize a function for 'get' at router