Added code for reading database. Working with client side (main window).