in reply to improper json response
You are trying to build a structure from a string that should be JSON, but it is not: instead, it contains a Perl error message "Not a SCALAR reference...". The source of the problem is probably the code that generates the JSON string, not the code that tries to read it.