anchor.diff:  %	end.
   
   generate_etag(ReqData, {battle, MapId, Session}) when is_list(MapId) ->
  -	BattleMap = boss_db:find(MapId),
  +	Id = list_to_integer(MapId),
  +	{ok, BattleMap} = rpgb_data:get_battlemap_by_id(Id),
   	generate_etag(ReqData, {battle, BattleMap, Session});
   
   generate_etag(ReqData, {battle, BattleMap, Session} = Ctx) ->
  -	Iolist = io_lib:format("~p:~p", [BattleMap:id(), BattleMap:updated_time()]),
  +	#battlemap{id = Id, updated = Updated} = BattleMap,
  +	Iolist = io_lib:format("~p:~p", [Id, Updated]),
   	IoBin = iolist_to_binary(Iolist),
   	Md5 = erlang:md5(IoBin),
   	Etag = mochihex:to_hex(Md5),
  
positive.code: 	{mochijson2:encode(Json), ReqData, Ctx}.
  
  encode_map(BattleMap) ->
  	{struct, MapStruct} = mochijson2:decode(BattleMap:to_json()),
  	Url = rpgb:get_url(["battles",BattleMap:id(),"slug"]),
  	{struct, [{<<"url">>, Url} | proplists:delete(<<"url">>, MapStruct)]}.
  
  to_html(ReqData, {battle, MapId, Session}) when is_list(MapId) ->
  	BattleMap = boss_db:find(MapId),
  	to_html(ReqData, {battle, BattleMap, Session});
  
  to_html(ReqData, {battle, BattleMap, Session} = Ctx) ->
  
negative.code: 	Name = proplists:get_value(<<"name">>, Props),
  	User = rpgb_session:get_user(Session),
  	Userid = proplists:get_value(id, User),
  	Maps = case rpgb_data:get_battlemap_by_owner_id(Userid) of
  		{ok, ML} -> ML;
  		_ -> []
  	end,
  	Filtered = [M || #battlemap{name = FName} = M <- Maps, M == Name],
  	case Filtered of
  		[] ->
  			BattleMap = #battlemap{name = Name, owner_id = Userid},
  			{ok, BattleMap0} = rpgb_data:save_battlemap(BattleMap),
  			NameSlug = rpgb:sluggify(Name),
  			Url = rpgb:get_url(["battles", BattleMap0:id(), NameSlug]),
  			{Url, ReqData, Ctx};
  