Separated api server into a few files.