anchor.diff:      precondition_failed(Req, State,
                           not_reachable_message(Unreachable),
                           unreachable_dep);
  -handle_depsolver_results(ok, {ok, Cookbooks}, Req, #base_state{chef_db_context = DbContext,
  +handle_depsolver_results(ok, {ok, Cookbooks}, Req, #base_state{reqid = _ReqId,
  +                                                               chef_db_context = DbContext,
                                                                  organization_guid = OrgId } = State) ->
       %% TODO - helper function to deal with the call and match on a chef_cookbook version
  -    CookbookRecords = chef_db:bulk_fetch_minimal_cookbook_versions(DbContext, OrgId, Cookbooks),
  -    assemble_response(Req, State, CookbookRecords).
  +    assemble_response(Req, State,
  +                      chef_db:bulk_fetch_minimal_cookbook_versions(DbContext, OrgId, Cookbooks)).
   
   %% @doc Utility function to remove some of the verbosity
   precondition_failed(Req, State, ErrorData, LogMsg) ->
  
positive.code: %% removing large fields such as long_description and attributes in
  %% the metadata that are not required by chef-client
  assemble_response(Req, #base_state{server_api_version = ApiVersion} = State, CookbookVersions) ->
      case oc_chef_wm_base:check_cookbook_authz(CookbookVersions, Req, State) of
          ok ->
              %% We iterate over the list again since we only want to construct the s3urls
              %% if the authz check has succeeded.  We use a minimal version of the
              %% cookbook which has just enough information for chef-client to run
              JsonList = {
                      [ { CBV#chef_cookbook_version.name,
                         chef_cookbook_version:minimal_cookbook_ejson(CBV, chef_wm_util:base_uri(Req), ApiVersion) }
                        || CBV <- CookbookVersions ]
                      },
              CBMapJson = chef_json:encode(JsonList),
              {true, wrq:append_to_response_body(CBMapJson, Req), State};
          {error, Msg} ->
              forbid(Req, State, Msg, {forbidden, read})
      end.
  
  %%------------------------------------------------------------------------------
  
negative.code: 
  %% Internal types
  -type cookbook_with_version() :: binary() | {binary(), binary()}.
  -define(CACHE_RETRY_INTERVAL, 200).
  -define(CACHE_MAX_RETRIES, 10).
  
  init(Config) ->
      oc_chef_wm_base:init(?MODULE, Config).
  