review fixes + test fixes
fixes PR comments
apply refactor to API classes too..
also unified the behavour between the UI and API