Updated the test script to work with json instead of plain text