Cloud code almost complete - moved for loop within async task, works outside of function but calls error for no response.success()