Wrote updateStats and getStat for db but haven't tested