Currently, unit tests for API modules emulate HTTP calls and rely on global state, both in PHP and in the database, to provide fixtures.
To simplify and speed up testing, we need a facility to instantiate API modules and inject (mock) services into them. Such a facility should be shared by all API tests.