added parse_response method