decodeResponse works with buffer