API improvements

This changes are needed for upcoming SailfishOS support.