Improve error reporting in API
Remove unused function name by changing declaration