wrote tests and methods for converting back to objects from json.