Fixed significant performance problem by correctly using WSGI