Improved migration script using promises
Fixing MongoApi calls that weren't working correctly