added serialize class for agent and service