classes to json