Database usage

Write final score to db