Refactored to use new httpserver api