trigger_custom_event and merge_table_records_with_pk api's integration

You don't need to get the instance in the module. The code is actually already called inside a client instance.