`$result` is not only a container of error messages,
`$result` = raw data, valid data and error messages.

So, i'd expect `json_encode($result)` to return:
`{rawData: {}, validData: {}, errorMessages: []}`