WSGI api fixes