completed appserver. works with testscript for numthreads < 4