Added failure util and updated web socket impl