Update views.py

Creates the main functionality of generating api