how frontend and backend work