deep conversion of object to json