   model.get @[id_param](), callback
 
 create_fn = (id_param, api_name, name, model, options) ->
-  (params = {}, callback) =>
+  (params = {}, callback, instant = false) =>
     unless callback?
       callback = (data) =>
         @[api_name].push model(data)
+
+    unless @.id?
+      console.error 'Empty ID. Save parent model first!'
+      return
+
+    if model.encrypted_container?
+      params = model.encrypt_container(params)
 
     if options.belongs_to?
       @.api()[api_name].create(options.belongs_to, @.id, params).done callback

      callback = (data) =>
        @[api_name].remove element

    if options.belongs_to?
      @.api()[api_name].destroy(options.belongs_to, @.id, id).done callback
    else


update_fn = (id_param, api_name, name, model, options) ->
  (id, params, callback) =>
    unless @.id?
      console.error 'Empty ID. Save parent model first!'
      return

    if model.encrypted_container?
      params = model.encrypt_container(params)

    if options.belongs_to?
      @.api()[api_name].update(options.belongs_to, @.id, id, params).done callback
    else
      @.api()[api_name].update(@.id, id, params).done callback

    if @.after_update?
      @.after_update()

destroy_fn = (id_param, api_name, name, model, options) ->
  (id, callback) =>
