Raise exception if unable to serialize JSON

- Updated the JsonModel to raise an exception if unable to serialize the data
as
 JSON.

Fixes zfcampus/zf-apigility#28