Call toJSON method from prototype Object class