Use serializer to serialize objects