Changes json array response for ajax calls into array of json objects with field en message property