Moved main.py content to views. Moved app creation to __init__