support to_dict() method for JSON