json should not be parsed if the buffer is empty