Various API bugfixes for correct app work.