A helper function to assign controller actions to routes in express