Added spec for toJSON