added backend with db query