fix bug around auth
return correct data with error
remove postgres dependency