add getStack and runStack function to Server