API code refactoring.
Merge branch 'master' of https://github.com/craftercms/studio3
More API refactoring.