Database logging

All actions have now implementation for database inserting. Need to test
it