redone to be regular wsgi