Deserialization fail

In different cases, when JSON is sent this error occurs:
`Warning: array_key_exists() expects parameter 2 to be array, string given in`
or
`Warning: array_key_exists() expects parameter 2 to be array, integer given in`