Making sure the bapi solution data is a string before using json_decode