Functionality of database and counter updates