updated services.py, implemented flask login for session management