added application architecture and functions for first 3 app to models.py