Updated curl response parsing to not break previous functionality. Added tests