async def METHOD_NAME(request, **kwargs):
    video = kwargs['video']
    if 'broadcast' in kwargs and kwargs['broadcast']:
        video = MediaRelay().subscribe(video)
    params = await request.json()
    METHOD_NAME = RTCSessionDescription(sdp=params['sdp'], type=params['type'])
    pc = RTCPeerConnection()
    pcs.add(pc)
    @pc.on('connectionstatechange')
    async def on_connectionstatechange():
        print('Connection state is %s' % pc.connectionState)
        if pc.connectionState == 'failed':
            await pc.close()
            pcs.discard(pc)
    # open media source
    audio = None
    await pc.setRemoteDescription(METHOD_NAME)
    for t in pc.getTransceivers():
        if t.kind == 'audio' and audio:
            pc.addTrack(audio)
        elif t.kind == 'video' and video:
            pc.addTrack(video)
    answer = await pc.createAnswer()
    await pc.setLocalDescription(answer)
    return web.Response(
        content_type='application/json',
        text=json.dumps(
            {'sdp': pc.localDescription.sdp, 'type': pc.localDescription.type}
        ),
    )