Fix bug in the API
Merge branch 'api-bug-fix'