handle errors in callback

if err != null then result == null and result[0] fails
test showing that the unique check fails
apply update operations to the inserted model
added ref to pull request raised (#67)
Merge pull request #67 from krisb/upsertOperations

Upsert operations