Replaced static counter id with ObjectId from db. (according to the issue I posted a few days ago)

The static counter id would fail since it is reset evry time the server
restarts. Using the db ObjectId ensures a globally uniq Id for the
objects.