Inject server function into tree