createDoc working, updateHeaders not working

Attempting to bring createDoc back online, but failing with
updateHeaders. Using vanilla XHR but not getting JSON. Using the
alt=json tag returns an empty response. Without it returns XML. TODO:
check that the old version could get JSON. TODO: Move the
angular.module to the background and try using the $http service
instead of vanilla.