Fix start ordering issue

only -api creates the database, so start it first.

(cherry picked from commit 2704f7d139ad06e046f0b56303d6748af88cc45b)