anchor.diff:          not_found ->
               NoCertMsg = bad_auth_message(no_cert),
               {false,
  -             wrq:set_resp_body(mochijson2:encode(NoCertMsg), Req), State};
  +             wrq:set_resp_body(ejson:encode(NoCertMsg), Req), State};
           CertInfo ->
               Cert = ?gv(cert, CertInfo),
               OrgId = ?gv(org_guid, CertInfo, State#state.organization_guid),
  
positive.code: 		true -> {true, Req1, State1};
  		false -> 
  		    Msg = bad_auth_message(not_member_of_org),
  		    Json = mochijson2:encode(Msg),
                      Req2 = wrq:set_resp_body(Json, Req),
  		    {false, Req2, State1}
  	    end;
  
negative.code:                      State1#state{organization_guid = OrgId, couchbeam = S}};
                  {no_authn, Reason} ->
                      Msg = bad_auth_message(Reason),
                      Json = ejson:encode(Msg),
                      Req1 = wrq:set_resp_body(Json, Req),
                      % TODO This is a needless mutation
                      {false, Req1, State1#state{couchbeam = S}}
  