try/catch the close, convert test to use internal http server