Fixed some issues in the backend and rewrote the frontend