[TS-3121] Add method is_valid_response()
[TS-3121] - fix indentation