Use API instead of calling external commands