modified app.py to send ratings to db