Bugfix, multiapi support rough coded