DAT-2374 add features to api

You can pass a variable by reference to a function so the function can modify the variable.
In this function err was changed, and section also.