+ def index
+ @objects.uniq!(&:id)
+ if params[:eager] and params[:eager] != '0' and params[:eager] != 0 and params[:eager] != ''
+ @objects.each(&:eager_load_associations)
+ end
+ render_list
+ end
+
+ def show
+ if @object
+ render json: @object.as_api_response
+ else
+ render_not_found("object not found")
+ end
+ end
+
+ def create
+ @object = model_class.new resource_attrs
+ @object.save
+ show
+ end
+
+ def update
+ attrs_to_update = resource_attrs.reject { |k,v|
+ [:kind, :etag, :href].index k
+ }
+ if @object.update_attributes attrs_to_update
+ show
+ else
+ render json: { errors: @object.errors.full_messages }, status: 422
+ end
+ end
+
+ def destroy
+ @object.destroy
+ show
+ end
+