anchor.diff:                      end
               end;
           {error, ErrorList} ->
  -            render_errors(ErrorList, AppInfo, Req)
  -    end,
  -    {Result, SessionID};
  -load_and_execute(development, {Controller, _, _} = Location, AppInfo, Req, SessionID) ->
  +            render_errors(ErrorList, AppInfo, RequestContext)
  +    end,
  +    {Result, proplists:get_value(session_id, RequestContext)};
  +load_and_execute(development, {Controller, _, _} = Location, AppInfo, RequestContext) ->
  +    SessionID = proplists:get_value(session_id, RequestContext),
       Application = AppInfo#boss_app_info.application,
       Res1 = boss_load:load_mail_controllers(Application),
       Res2 = case Res1 of
  
positive.code: process_redirect(_, Where, _) ->
      Where.
  
  process_action_result(Info, ok, ExtraHeaders, AppInfo, AuthInfo) ->
      process_action_result(Info, {ok, []}, ExtraHeaders, AppInfo, AuthInfo);
  process_action_result(Info, {ok, Data}, ExtraHeaders, AppInfo, AuthInfo) ->
      process_action_result(Info, {ok, Data, []}, ExtraHeaders, AppInfo, AuthInfo);
  process_action_result({Location, Req, SessionID, _}, {ok, Data, Headers}, ExtraHeaders, AppInfo, AuthInfo) ->
      render_view(Location, AppInfo, Req, SessionID, [{"_before", AuthInfo}|Data], merge_headers(Headers, ExtraHeaders));
  
  process_action_result(Info, js, ExtraHeaders, AppInfo, AuthInfo) ->
      process_action_result(Info, {js, []}, ExtraHeaders, AppInfo, AuthInfo);
  process_action_result(Info, {js, Data}, ExtraHeaders, AppInfo, AuthInfo) ->
      process_action_result(Info, {js, Data, [{"Content-Type","application/javascript"}]}, ExtraHeaders, AppInfo, AuthInfo);
  process_action_result({Location, Req, SessionID, _}, {js, Data, Headers}, ExtraHeaders, AppInfo, AuthInfo) ->
      render_view(Location, AppInfo, Req, SessionID, [{"_before", AuthInfo}|Data], merge_headers(Headers, ExtraHeaders));
  
  process_action_result(Info, {render_other, OtherLocation}, ExtraHeaders, AppInfo, AuthInfo) ->
      process_action_result(Info, {render_other, OtherLocation, []}, ExtraHeaders, AppInfo, AuthInfo);
  process_action_result(Info, {render_other, OtherLocation, Data}, ExtraHeaders, AppInfo, AuthInfo) ->
      process_action_result(Info, {render_other, OtherLocation, Data, []}, ExtraHeaders, AppInfo, AuthInfo);
  process_action_result({{Controller, _, _}, Req, SessionID, _}, {render_other, OtherLocation, Data, Headers}, ExtraHeaders, AppInfo, AuthInfo) ->
      render_view(process_location(Controller, OtherLocation, AppInfo),
          AppInfo, Req, SessionID, [{"_before", AuthInfo}|Data], merge_headers(Headers, ExtraHeaders));
  
  process_action_result({{Controller, _, _}, Req, SessionID, LocationTrail}, {action_other, OtherLocation}, _, AppInfo, _) ->
      execute_action(process_location(Controller, OtherLocation, AppInfo), AppInfo, Req, SessionID, LocationTrail);
  
  process_action_result({_, Req, SessionID, LocationTrail}, not_found, _, AppInfo, _) ->
      case boss_router:handle(AppInfo#boss_app_info.router_pid, 404) of
          {ok, {Application, Controller, Action, Params}} when Application =:= AppInfo#boss_app_info.application ->
              case execute_action({Controller, Action, Params}, AppInfo, Req, SessionID, LocationTrail) of
                  {ok, Payload, Headers} ->
                      {not_found, Payload, Headers};
                  Other ->
  
negative.code: process_result(_, _, {StatusCode, Payload, Headers}) when is_integer(StatusCode) ->
      {StatusCode, merge_headers(Headers, [{"Content-Type", "text/html"}]), Payload}.
  
  load_and_execute(Mode, {Controller, _, _} = Location, AppInfo, RequestContext) when Mode =:= production; Mode =:= testing->
      case boss_files:is_controller_present(AppInfo#boss_app_info.application, Controller,
              AppInfo#boss_app_info.controller_modules) of
          true -> execute_action(Location, AppInfo, RequestContext);
          false -> {render_view(Location, AppInfo, RequestContext)}
      end;
  %% @desc handle requests to /doc and return EDoc generated html
  load_and_execute(development, {"doc", ModelName, _}, AppInfo, RequestContext) ->
      Result = case boss_load:load_models(AppInfo#boss_app_info.application) of
          {ok, ModelModules} ->
              % check if ModelName is in list of models
  