def getAGSurveyDetails(self, survey_id, language):
        """Returns survey information of a specific survey_id and language

        Parameters
        ----------
        survey_id : str
            the id of the survey group
        language : str
            the language the survey is intended for

        Returns
        -------
        DataFrame
            pandas DataFrame of sorted survey details

        Raises
        ------
        ValueError
            survey_id not found in database
        ValueError
            language not found in database
        """
        if survey_id not in self.getKnownSurveyIds():
            raise ValueError('Invalid survey_id')
        if language not in self.getKnownLanguages():
            raise ValueError('Invalid language')

        sql = """SELECT survey_question_id,
                        survey_group,
                        %s,
                        question_shortname,
                        response,
                        ag.survey_question_response.display_index
                            AS response_index
                 FROM ag.survey_question
                 LEFT JOIN ag.survey_question_response
                     USING (survey_question_id)
                 LEFT JOIN ag.group_questions USING (survey_question_id)
                 LEFT JOIN ag.surveys USING (survey_group)
                 WHERE survey_id = %s""" % (language, survey_id)

        with TRN:
            TRN.add(sql)
            survey_details = TRN.execute_fetchindex()

        df = pd.DataFrame([dict(r) for r in survey_details],
                          columns=['survey_question_id',
                                   'survey_group',
                                   language,
                                   'question_shortname',
                                   'response',
                                   'response_index'])
        # sorts so that questions emmulate survey order
        df = df.sort_values(by=['survey_group',
                                'survey_question_id',
                                'response_index']).drop(columns='survey_group')
        # converts response_index from float to int
        df['response_index'] = df['response_index'].apply(
                lambda x: None if np.isnan(x) else int(x), convert_dtype=False)
        return df