some fix

sql new method of returning data.
improved autorisations