API base flag and minor bugfixes for CLI