Type Hinting improvements
Use the UpsertResult class so we can check if it was a update or insert
Merge branch 'type_hints'