Call the appropriate function

        :param dict request: request that describes the function to call
        :return: response linked to the request that holds the value returned by the called function
        :rtype: dict

def call(self, request):
        """Call the appropriate function

        :param dict request: request that describes the function to call
        :return: response linked to the request that holds the value returned by the called function
        :rtype: dict

        """
        result = None
        try:
            if 'extAction' in request:  # DirectSubmit method
                tid = request['extTID']
                action = request['extAction']
                method = request['extMethod']
            else:
                tid = request['tid']
                action = request['action']
                method = request['method']
            element = self.configuration[action][method]
            if isinstance(element, tuple):  # class level function
                func = getattr(self.instances[element[0]], element[1])
            else:  # module level function
                func = element
            if func.exposed_kind == BASIC:  # basic method
                args = request['data'] or []
                result = func(*args)
            elif func.exposed_kind == LOAD:  # DirectLoad method
                args = request['data'] or []
                result = {'success': True, 'data': func(*args)}
            elif func.exposed_kind == SUBMIT:  # DirectSubmit method
                kwargs = request
                for k in ['extAction', 'extMethod', 'extType', 'extTID', 'extUpload']:
                    if k in kwargs:
                        del kwargs[k]
                try:
                    func(**kwargs)
                    result = {'success': True}
                except FormError as e:
                    result = e.extra
                    result['success'] = False
                    if e.errors:
                        result['errors'] = e.errors
            elif func.exposed_kind == STORE_READ:  # DirectStore read method
                kwargs = request['data'] or {}
                data = func(**kwargs)
                result = {'total': len(data), 'data': data}
            elif func.exposed_kind == STORE_CUD:  # DirectStore create-update-destroy methods
                kwargs = request['data'][0] or {}
                try:
                    result = {'success': True, 'data': func(**kwargs)}
                except Error:
                    result = {'success': False}
        except Exception as e:
            if self.debug:
                return {'type': 'exception', 'message': str(e), 'where': '%s.%s' % (action, method)}
        return {'type': 'rpc', 'tid': tid, 'action': action, 'method': method, 'result': result}