Adding __sleep and jsonSerialize methods