Refactored swagger so that it can handle multiple instantiations