Updated the serializer to convert object IDs to string if requested.