Move Database stuff to models.py

* Add all query logic to a ParkingSpot class
* All db connecting/disconnecting is done in models.py
* Return proper HTTP codes
Add some tests