updating api to return cleaner output