app/actions: use proper function to check duplication errors on mongo