Porting from CLI To Rest API