def call_validator_api(dsn, api_data):
    _filename = dsn + ".lpd"
    try:
        api_data = json.dumps(api_data)
        payload = {'json_payload': api_data, 'apikey': 'lipd_linked'}
        response = requests.post('http://www.lipd.net/api/validator', data=payload)
        if response.status_code == 413:
            result = {"dat": {}, "feedback": {}, "filename": _filename,
                      "status": "HTTP 413: Request Entity Too Large"}
        elif response.status_code == 404:
            result = {"dat": {}, "feedback": {}, "filename": _filename,
                      "status": "HTTP 404: Not Found"}
        elif response.status_code == 400:
            result = {"dat": {}, "feedback": {}, "filename": _filename,
                      "status": response.text}
        else:
            result = json.loads(response.text)
    except TypeError as e:
        logger_validator_api.warning("get_validator_results: TypeError: {}".format(e))
        result = {"dat": {}, "feedback": {}, "filename": _filename, "status": "JSON DECODE ERROR"}
    except requests.exceptions.ConnectionError as e:
        logger_validator_api.warning("get_validator_results: ConnectionError: {}".format(e))
        result = {"dat": {}, "feedback": {}, "filename": _filename, "status": "UNABLE TO REACH SERVER"}
    except Exception as e:
        logger_validator_api.debug("get_validator_results: Exception: {}".format(e))
        result = {"dat": {}, "feedback": {}, "filename": _filename, "status": "ERROR BEFORE VALIDATION, {}".format(e)}
    if not result:
        result = {"dat": {}, "feedback": {}, "filename": _filename, "status": "EMPTY RESPONSE"}
    result["filename"] = _filename
    return result