Add segment cat api
Remove trailing whitespaces in cat client