added client->close hack for api server