almost working backend
made some changes