Minister Wei is afraid of mice (and apparently, so is YiYi). He was treated well in prison, it’s just that no one knew about his fear of the ‘mouse’ in his cell. When he lamented to her how horrible the experience was, YiYi took it to mean that the emperor had him tortured. This is the main reason she still refuses to marry the emperor - she can’t forgive him for hurting her father.