def check_headers(headers):
    """Return True if the headers have the required keys.

    Parameters
    ----------
    headers : dict
        should contains 'content-type' and 'x-mailerlite-apikey'

    Returns
    -------
    valid_headers : bool
        True if it is valid
    error_msg : str
        the error message if there is any problem

    """
    valid_headers = True
    error_msg = ''
    if not headers:
        error_msg = 'Empty headers. Please enter a valid one'
        valid_headers = False
        return valid_headers, error_msg
    if not isinstance(headers, dict):
        error_msg = 'headers should be a dictionnary'
        valid_headers = False
        return valid_headers, error_msg
    if 'content-type' not in headers or 'x-mailerlite-apikey' not in headers:
        error_msg = 'headers should be a dictionnary and it contains '
        error_msg += "'content-type' and 'x-mailerlite-apikey' as keys"
        valid_headers = False
        return valid_headers, error_msg
    return valid_headers, error_msg
