Fix null ObjectId in createObject() and modifyObject()

Happen if you try to create/update a resource with a null ObjectId.

For example:
```
{
_customer: null
}
```

while customer is an ObjectId in the Schema.