Factory modified, now api/__init__.py has the inizialitation of security