anchor.diff:                       State1#state{organization_guid = OrgId, couchbeam = S}};
                   {no_authn, Reason} ->
                       Msg = bad_auth_message(Reason),
  -                    Json = mochijson2:encode(Msg),
  +                    Json = ejson:encode(Msg),
                       Req1 = wrq:set_resp_body(Json, Req),
                       % TODO This is a needless mutation
                       {false, Req1, State1#state{couchbeam = S}}
  
positive.code:     catch
          throw:org_not_found ->
              NoOrg = bad_auth_message(org_not_found),
              Req1 = wrq:set_resp_body(mochijson2:encode(NoOrg), Req),
              {{halt, 404}, Req1, State};
          throw:_X ->
              {{halt, 500}, Req, State}
  
negative.code:     SolrDataRaw = solr_query(Url),
      % FIXME: Probably want a solr module that knows how to query solr
      % and parse its responses.
      SolrData = ejson:decode(SolrDataRaw),
      DocList = ej:get({<<"response">>, <<"docs">>}, SolrData),
      Ids = [ ej:get({<<"X_CHEF_id_CHEF_X">>}, Doc) || Doc <- DocList ],
      Docs = chef_otto:bulk_get(S, ?db_for_guid(Db), Ids),
  