You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: routes.go
    path of file: ./repos/feedback/models
    
    the code of the file until where you have to start completion: package models

import (
	"bytes"
	"fmt"
	"strings"
	"text/template"

	"github.com/andrewarrow/feedback/util"
)

type Route struct {
	Root  string  `json:"root"`
	Paths []*Path `json:"paths"`
}

type Path struct {
	Verb     string `json:"verb"`
	Second   string `json:"second"`
	Third    string `json:"third"`
	Params   string `json:"params"`
	Response string `json:"response"`
}

fun
    
func (r *Route) Generate(root string) string {

	buffer1 := []string{}
	buffer2 := []string{}
	names := []string{}
	params := []string{}
	logic := ""
	name := ""
	param := ""
	for _, path := range r.Paths {
		logic, name, param = handlePath(root, path.Verb, path.Second, path.Third)
		buffer1 = append(buffer1, logic)
		names = append(names, name)
		params = append(params, param)
	}
	for i, name := range names {
		logic := handleFuncs(name, params[i])
		buffer2 = append(buffer2, logic)
	}
	content := strings.Join(buffer1, "\n")
	top := handleWrapper(root, content)

	funcs := strings.Join(buffer2, "\n")

	return top + "\n\n" + funcs
}