'* POST /api/dataset_collections:
create a new dataset collection instance.
:type   payload: dict
:param  payload: (optional) dictionary structure containing:
* collection_type: dataset colltion type to create.
* instance_type:   Instance type - \'history\' or \'library\'.
* name:            the new dataset collections\'s name
* datasets:        object describing datasets for collection
:rtype:     dict
:returns:   element view of new dataset collection'

@expose_api
def create(self, trans, payload, **kwd):

    create_params = api_payload_to_create_params(payload)
    instance_type = payload.pop('instance_type', 'history')
    if (instance_type == 'history'):
        history_id = payload.get('history_id')
        history_id = self.decode_id(history_id)
        history = self.history_manager.get_owned(history_id, trans.user, current_history=trans.history)
        create_params['parent'] = history
    elif (instance_type == 'library'):
        folder_id = payload.get('folder_id')
        library_folder = self.get_library_folder(trans, folder_id, check_accessible=True)
        self.check_user_can_add_to_library_item(trans, library_folder, check_accessible=False)
        create_params['parent'] = library_folder
    else:
        trans.status = 501
        return
    dataset_collection_instance = self.__service(trans).create(trans=trans, **create_params)
    return dictify_dataset_collection_instance(dataset_collection_instance, security=trans.security, parent=create_params['parent'])
