Make sure non-ObjectId ids are strings for URL compatibility