Fix an error in handling responses from REMS
Remove unused imports