Add support for UI unit testing

Adds a custom header that is checked on the dispatcher and enables
unit testing on the API. Part of #781