Apply new API functions
Bugfix