Replaced API init code