Loop to create resources with MODX API