     @uuid = @opts.uuid || @attributes.uuid || App.UUID.generate()
     @id = @opts.id || @attributes.id
 
-    @template = template.replace(/\b(data-k-uuid)\.?[^\s]+/g, "data-k-uuid=" + @uuid)
-    @template = @template.replace(/\b(data-id)\.?[^\s]+/g, "data-id=" + @id)
+    @template = template.replace(/\b(data-k-uuid)\.?[^\s|>]+/g, "data-k-uuid=" + @uuid)
+    @template = @template.replace(/\b(data-id)\.?[^\s|>]+/g, "data-id=" + @id)
+    @build_attrs_template()
 
   @set_template: (template) ->
     @template = template

    ).responseText

    obj = JSON.parse(response)

    @handle_errors(obj)

  destroy: ->
    @route ||= @model.replace("-", "_") + "s"


  set_attributes: (attrs) ->
    $.each attrs, (attr, val) =>
      if attr == "id" && !isNaN(parseFloat(val)) && isFinite(val)
        @id = val
      @set(attr, val)

  append_to_page: ->
