Add API tests

closes #1189
- added tests
- added request module
- added status codes to API calls
- fixed return values of API calls
- fixed that drafts caused an error when being deleted
- fixed X-Invalidate-Cache headers
- moved testUtils.js to utils/index.js
Merge pull request #1322 from sebgie/api-refactor

Add API tests
Remove timeouts on tests
Alphabetical package.json cos OCD
Run tests on MySQL and use travis-$DB environments.

refs #921
fixes #1385
Bugfixes for tests
Merge pull request #1393 from halfdan/1385-travis-testing

Run tests on MySQL and use travis-$DB environments.