Check that request JSON does not contain too long strings

This is done to prevent DOS attacks on our service or underlying database.

Change-Id: Iaef4566f6233fba1a419c441f3add60887d625af