code: func matcherFunc(r domain.Route, defaultHandler http.HandlerFunc, ctx domain.IContext, ac domain.IAccessController) func(r *http.Request, rm *mux.RouteMatch) bool {
  	return func(req *http.Request, rm *mux.RouteMatch) bool {
  		acceptHeaders := domain.NewAcceptHeadersFromString(req.Header.Get("accept"))
  		foundHandler := defaultHandler
  		// try to match a handler to the specified `version` params
  		// else we will fall back to the default handler
  		for _, h := range acceptHeaders {
  			m := h.MediaType
  			// check if media type is `application/json` type or `application/[*]+json` suffix
  			if !(m.Type == "application" && (m.SubType == "json" || m.Suffix == "json")) {
  				continue
  			}
  
  			// if its the right application type, check if a version specified
  			version, hasVersion := m.Parameters["version"]
  			if !hasVersion {
  				continue
  			}
  			if handler, ok := r.RouteHandlers[domain.RouteHandlerVersion(version)]; ok {
  				// found handler for specified version
  				foundHandler = handler
  				break
  			}
  		}
  
  		if ac != nil {
  			rm.Handler = ac.NewContextHandler(r.Name, foundHandler)
  		} else {
  			rm.Handler = foundHandler
  		}
  		return true
  	}
  }
docs: // matcherFunc matches the handler to the correct API version based on its `accept` header
  // TODO: refactor matcher function as server.Config