Ensure object id is set only when needed

Set the object id only when object id is not passed as a parameter while creating a Datastore object