def METHOD_NAME(request, response):
    if b"action" not in request.GET:
        return False
    action = request.GET[b"action"]
    key = request.GET[b"key"]
    stash = request.server.stash
    path = request.GET[b"path"] if b"path" in request.GET \
           else isomorphic_encode(request.url.split(u'?')[0])
    if action == b"put":
        value = isomorphic_decode(request.GET[b"value"])
        stash.take(key=key, path=path)
        stash.put(key=key, value=value, path=path)
        response_data = json.dumps({u"status": u"success", u"result": isomorphic_decode(key)})
    elif action == b"purge":
        value = stash.take(key=key, path=path)
        return False
    elif action == b"take":
        value = stash.take(key=key, path=path)
        if value is None:
            status = u"allowed"
        else:
            status = u"blocked"
        response_data = json.dumps({u"status": status, u"result": value})
    else:
        return False
    response.add_required_headers = False
    response.writer.write_status(200)
    response.writer.write_header(b"content-type", b"text/javascript")
    response.writer.write_header(b"cache-control", b"no-cache; must-revalidate")
    response.writer.end_headers()
    response.writer.write(response_data)
    return True