Added code to access the database using loaders. Also fixed bugs and refactored classes.