Moved to flask
Moved logic from service to service object and added security