Improving backend and fixing bugs