<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_top_level(self, body):
 """ Ensure compliance with the spec's top-level section """


        link = 'jsonapi.org/format/#document-top-level'

        try:
            if not isinstance(body['data'], dict):
                raise TypeError
        except (KeyError, TypeError):
            self.fail('JSON API payloads MUST be a hash at the most '
                      'top-level; rooted at a key named `data` where the '
                      'value must be a hash. Currently, we only support '
                      'JSON API payloads that comply with the single '
                      'Resource Object section.', link)

        if 'errors' in body:
            self.fail('JSON API payloads MUST not have both `data` & '
                      '`errors` top-level keys.', link)