add option to use external catalog in apmag