Add cURL error check in performRequest()

Added curl_error() check and return of valid JSON on error in performRequest().