Finished table generation and added database close method as well as command handlers