It looks like
data is a string, that would mean
response is double encoded.
var data = JSON.parse(JSON.parse(response));
If that works go to your server side code and fix the double encoding and ofcourse remove the double parsing on the client side.
getByIdModel both calls
json_encode, I would remove it from
getByIdModel so your data isn't encoded twice.
With respect to the whole json parsing point, if your ajax request expects json set the