created a custom json encoder class for each class