revised API and simplified httpserver