added check for string instances in handling server responses