Fixed webserver implementation according to PhantomJS API