anchor.diff:  		{error, Reason} ->
   			{error, Reason}
   	end.
  -
  --spec create_table(Tables) -> Result
  -	when
  -		Tables :: [atom()],
  -		Result :: ok | {error, Reason},
  -		Reason :: term().
  -%% @doc Create mnesia tables.
  -%% @private
  -create_table([Table | Tables]) when is_atom(Table) ->
  -	case create_table(Table, mnesia:system_info(db_nodes)) of
  -		ok ->
  -			create_table(Tables);
  -		{error, Reason} ->
  -			{error, Reason}
  -	end;
  -create_table([]) ->
  -	ok.
   
   -spec create_table(Table, Nodes) -> Result
   	when
  
positive.code: %% @see //kernel/application:start/2
  %%
  start(normal = _StartType, _Args) ->
  	Tables = [client, service, offer, product, resource,
  			bucket, httpd_user, httpd_group, session, nrf_ref],
  	case mnesia:wait_for_tables(Tables, ?WAITFORTABLES) of
  		ok ->
  			start1();
  		{timeout, BadTabList} ->
  			case create_table(BadTabList) of
  				ok ->
  					case force(BadTabList) of
  						ok ->
  							start1();
  						{error, Reason} ->
  							error_logger:error_report(["ocs application failed to"
  									" start", {reason, Reason}, {module, ?MODULE}]),
  							{error, Reason}
  					end;
  				{error, Reason} ->
  					error_logger:error_report(["failed to create missing tables",
  							{reason, Reason}, {module, ?MODULE}]),
  					{error, Reason}
  			end;
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start1() ->
  	case inets:services_info() of
  		ServicesInfo when is_list(ServicesInfo) ->
  			{ok, Profile} = application:get_env(hub_profile),
  			start2(Profile, ServicesInfo);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start2(Profile, [{httpc, _Pid, Info} | T]) ->
  	case proplists:lookup(profile, Info) of
  		{profile, Profile} ->
  			start3(Profile);
  		_ ->
  			start2(Profile, T)
  	end;
  start2(Profile, [_ | T]) ->
  	start2(Profile, T);
  start2(Profile, []) ->
  	case inets:start(httpc, [{profile, Profile}]) of
  		{ok, _Pid} ->
  			start3(Profile);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start3(Profile) ->
  	{ok, Options} = application:get_env(hub_options),
  	case httpc:set_options(Options, Profile) of
  		ok ->
  			start4();
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start4() ->
  	case inets:services_info() of
  		ServicesInfo when is_list(ServicesInfo) ->
  			{ok, Profile} = application:get_env(nrf_profile),
  			start5(Profile, ServicesInfo);
  		{error, Reason} ->
  			{error, Reason}
  	end.
  %% @hidden
  start5(Profile, [{httpc, _Pid, Info} | T]) ->
  	case proplists:lookup(profile, Info) of
  		{profile, Profile} ->
  			start6(Profile);
  		_ ->
  			start5(Profile, T)
  	end;
  start5(Profile, [_ | T]) ->
  	start5(Profile, T);
  start5(Profile, []) ->
  	case inets:start(httpc, [{profile, Profile}]) of
  		{ok, _Pid} ->
  			start6(Profile);
  
negative.code: 			{error, Reason}
  	end.
  %% @hidden
  install16(Tables, true) ->
  	case inets:start() of
  		ok ->
  			error_logger:info_msg("Started inets.~n"),
  			install17(Tables);
  		{error, {already_started, inets}} ->
  			install17(Tables);
  		{error, Reason} ->
  			error_logger:error_msg("Failed to start inets~n"),
  			{error, Reason}
  	end;
  install16(Tables, false) ->
  	{ok, Tables}.
  %% @hidden
  install17(Tables) ->
  	case ocs:list_users() of
  		{ok, []} ->
  			case ocs:add_user("admin", "admin", "en") of
  