Issue 2443

- Refactor API tests from `/core/test/functional/api` to
  `/core/test/functional/routes/api`, using supertest instead of request
- Merge ErisDS/issue-2442, in order to close the httpserver created by
  call ghost()
- Remove `core/test/functional/api` folder