Update MAF to db script to use API