Added check for the direction of the sort parameter.
Added TODO for checking the length of JSON before trying to parse from a string-based where parameter.
Removed unnecessary split on the attribute while validating where parameter.
Updated error response to include count of attributes affected by validation errors.