fixed json decoding bug causing the data to be returned as a json string rather than PHP array