Added security layer

added security and fixed some includes