implement class serializer in network

issue #189