Added support for pre_functions at routes