securing api/secure methods and removing old code and pages