Refactor API and dev app further.