Added dataloader and fixed sql errors