added origin header
added header globally before errors, improved responses