Added logging of functions calls and store timestamps to database