add toJSON override to limit attributes sent to the client