Added support for handling trailing headers to WS API