Fixed bug where swagger would fail if models was undefined.