preliminary wsgi implementation,
while keeping the old functionality