changed creation of application within tests to be exactly the same as when called via http