fix rest api stream reader