has background thread, untested with web server