Index: backend/auth_form/serializers.py
===================================================================
--- backend/auth_form/serializers.py	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ backend/auth_form/serializers.py	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -66,5 +66,5 @@
             return data
         else:
-            serializers.ValidationError('Must include "email" and "password"')
+            raise serializers.ValidationError('Must include "email" and "password"')
 
 class StudentFormSerializer(serializers.ModelSerializer):
Index: backend/auth_form/views.py
===================================================================
--- backend/auth_form/views.py	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ backend/auth_form/views.py	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -56,5 +56,5 @@
         if self.request.method=='POST':
             return [IsAuthenticated(), CanSubmitForm(), IsStudent()]
-        elif self.request.method == 'PUT':
+        elif self.request.method == 'PATCH':
             return [IsAuthenticated(), IsStudent(), CanUpdateForm()]
         return [IsAuthenticated(), IsStudent()]
Index: frontend/src/components/LogoutButton.tsx
===================================================================
--- frontend/src/components/LogoutButton.tsx	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ frontend/src/components/LogoutButton.tsx	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -1,9 +1,11 @@
 import React from "react";
 import { useNavigate } from "react-router-dom";
+import { useAuth } from "../hooks/useAuth"; 
 
 const LogoutButton: React.FC = () => {
   const navigate = useNavigate();
+  const { logout } = useAuth();
   const handleLogout = () => {
-    localStorage.removeItem("token");
+    logout()
     navigate("/login");
   };
Index: frontend/src/components/Navbar.tsx
===================================================================
--- frontend/src/components/Navbar.tsx	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ frontend/src/components/Navbar.tsx	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -6,136 +6,138 @@
 
 const Navbar: React.FC = () => {
-	const [menuOpen, setMenuOpen] = useState(false);
-	const { isAuthenticated, logout } = useAuth();
-	const navigate = useNavigate();
-	const { login } = useAuth();
+  const [menuOpen, setMenuOpen] = useState(false);
+  const { isAuthenticated, logout } = useAuth();
+  const navigate = useNavigate();
+  const { login } = useAuth();
 
-	const handleLogout = () => {
-		logout();
-		navigate("/");
-	};
+  const handleLogout = () => {
+    logout();
+    navigate("/");
+  };
 
-	const testAccountLogin = async () => {
-		if (isAuthenticated) return;
-		try {
-			const response = await axios.post("http://localhost:8000/auth/login/", {
-				email: "fffff@finki.ukim.mk",
-				password: "testTestTEST123",
-			});
-			const { access, refresh } = response.data;
-			login(access, refresh);
-			navigate("/");
-		} catch (err: unknown) {
-			console.log(err);
-		}
-	};
+  const testAccountLogin = async () => {
+    if (isAuthenticated) return;
+    try {
+      const response = await axios.post("http://localhost:8000/auth/login/", {
+        email: "fffff@finki.ukim.mk",
+        password: "testTestTEST123",
+      });
+      const { access, refresh } = response.data;
+      login(access, refresh);
+      navigate("/");
+    } catch (err: unknown) {
+      console.log(err);
+    }
+  };
 
-	return (
-		<nav className="bg-gray-800 text-white p-4">
-			<div className="flex justify-between items-center">
-				<div className="flex items-center space-x-4">
-					<Link to="/">
-						<img
-							src={IOimage}
-							alt="Дома"
-							className="w-10 h-10 object-cover rounded-lg shadow-md hover:scale-110 transition duration-300"
-						/>
-					</Link>
-				</div>
-				<button
-					onClick={() => setMenuOpen(!menuOpen)}
-					className="sm:hidden focus:outline-none"
-				>
-					<svg
-						className="w-6 h-6"
-						fill="none"
-						stroke="currentColor"
-						viewBox="0 0 24 24"
-					>
-						{menuOpen ? (
-							<path
-								strokeLinecap="round"
-								strokeLinejoin="round"
-								strokeWidth="2"
-								d="M6 18L18 6M6 6l12 12"
-							/>
-						) : (
-							<path
-								strokeLinecap="round"
-								strokeLinejoin="round"
-								strokeWidth="2"
-								d="M4 6h16M4 12h16M4 18h16"
-							/>
-						)}
-					</svg>
-				</button>
+  return (
+    <nav className="bg-gray-800 text-white p-4">
+      <div className="flex justify-between items-center">
+        <div className="flex items-center space-x-4">
+          <Link to="/">
+            <img
+              src={IOimage}
+              alt="Дома"
+              className="w-10 h-10 object-cover rounded-lg shadow-md hover:scale-110 transition duration-300"
+            />
+          </Link>
+        </div>
+        <button
+          onClick={() => setMenuOpen(!menuOpen)}
+          className="sm:hidden focus:outline-none"
+        >
+          <svg
+            className="w-6 h-6"
+            fill="none"
+            stroke="currentColor"
+            viewBox="0 0 24 24"
+          >
+            {menuOpen ? (
+              <path
+                strokeLinecap="round"
+                strokeLinejoin="round"
+                strokeWidth="2"
+                d="M6 18L18 6M6 6l12 12"
+              />
+            ) : (
+              <path
+                strokeLinecap="round"
+                strokeLinejoin="round"
+                strokeWidth="2"
+                d="M4 6h16M4 12h16M4 18h16"
+              />
+            )}
+          </svg>
+        </button>
 
-				<div className="hidden sm:flex space-x-4 items-center text-sm sm:text-base">
-					<button onClick={testAccountLogin}>quick login</button>
-					<Link to="/subjects" className="hover:underline">
-						Предмети
-					</Link>
-					<Link to="/recommendations" className="hover:underline">
-						Препораки
-					</Link>
-					{isAuthenticated && (
-						<Link to="/account" className="hover:underline">
-							Профил
-						</Link>
-					)}
-					{isAuthenticated ? (
-						<button
-							onClick={handleLogout}
-							className="bg-red-500 hover:bg-red-600 px-3 py-1 rounded"
-						>
-							Одјави се
-						</button>
-					) : (
-						<>
-							<Link to="/login" className="hover:underline">
-								Најави се
-							</Link>
-							<Link to="/register" className="hover:underline">
-								Регистрирај се
-							</Link>
-						</>
-					)}
-				</div>
-			</div>
+        <div className="hidden sm:flex space-x-4 items-center text-sm sm:text-base">
+          <button onClick={testAccountLogin}>quick login</button>
+          <Link to="/subjects" className="hover:underline">
+            Предмети
+          </Link>
+          {isAuthenticated && (
+            <Link to="/recommendations" className="hover:underline">
+              Препораки
+            </Link>
+          )}
+          {isAuthenticated && (
+            <Link to="/account" className="hover:underline">
+              Профил
+            </Link>
+          )}
+          {isAuthenticated ? (
+            <button
+              onClick={handleLogout}
+              className="bg-red-500 hover:bg-red-600 px-3 py-1 rounded"
+            >
+              Одјави се
+            </button>
+          ) : (
+            <>
+              <Link to="/login" className="hover:underline">
+                Најави се
+              </Link>
+              <Link to="/register" className="hover:underline">
+                Регистрирај се
+              </Link>
+            </>
+          )}
+        </div>
+      </div>
 
-			{menuOpen && (
-				<div className="sm:hidden mt-3 flex flex-col space-y-2 text-sm">
-					<Link to="/subjects" className="hover:underline">
-						Предмети
-					</Link>
-					{isAuthenticated && (
-						<Link to="/account" className="hover:underline">
-							Профил
-						</Link>
-					)}
-					{isAuthenticated ? (
-						<button
-							onClick={() => {
-								handleLogout();
-								setMenuOpen(false);
-							}}
-							className="bg-red-500 hover:bg-red-600 px-3 py-1 rounded"
-						>
-							Одјави се
-						</button>
-					) : (
-						<>
-							<Link to="/login" onClick={() => setMenuOpen(false)}>
-								Најави се
-							</Link>
-							<Link to="/register" onClick={() => setMenuOpen(false)}>
-								Регистрирај се
-							</Link>
-						</>
-					)}
-				</div>
-			)}
-		</nav>
-	);
+      {menuOpen && (
+        <div className="sm:hidden mt-3 flex flex-col space-y-2 text-sm">
+          <Link to="/subjects" className="hover:underline">
+            Предмети
+          </Link>
+          {isAuthenticated && (
+            <Link to="/account" className="hover:underline">
+              Профил
+            </Link>
+          )}
+          {isAuthenticated ? (
+            <button
+              onClick={() => {
+                handleLogout();
+                setMenuOpen(false);
+              }}
+              className="bg-red-500 hover:bg-red-600 px-3 py-1 rounded"
+            >
+              Одјави се
+            </button>
+          ) : (
+            <>
+              <Link to="/login" onClick={() => setMenuOpen(false)}>
+                Најави се
+              </Link>
+              <Link to="/register" onClick={() => setMenuOpen(false)}>
+                Регистрирај се
+              </Link>
+            </>
+          )}
+        </div>
+      )}
+    </nav>
+  );
 };
 
Index: frontend/src/context/AuthProvider.tsx
===================================================================
--- frontend/src/context/AuthProvider.tsx	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ frontend/src/context/AuthProvider.tsx	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -12,5 +12,4 @@
     localStorage.getItem("refresh_token")
   );
-
   const refreshAccessToken = async (): Promise<string | null> => {
     const refreshToken = localStorage.getItem("refresh_token");
@@ -21,5 +20,5 @@
     try {
       const response = await axiosInstance.post<{ access: string; refresh?: string }>(
-        "http://localhost:8000/auth/refresh/",
+        "/auth/refresh/",
         { refresh: refreshToken }
       );
@@ -38,5 +37,6 @@
     } catch (error) {
       console.error("Error refreshing access token:", error);
-      return Promise.reject(error); // Propagate the error
+      logout();
+      return null;
     }
   };
Index: frontend/src/pages/Account.tsx
===================================================================
--- frontend/src/pages/Account.tsx	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ frontend/src/pages/Account.tsx	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -27,5 +27,5 @@
                 // probably navigate the user away.
                 console.error("Could not fetch form data after retries.", error);
-                navigate("/login");
+                //navigate("/login");
             } finally {
                 // This will run whether the request succeeded or failed.
Index: frontend/src/pages/Recommendations.tsx
===================================================================
--- frontend/src/pages/Recommendations.tsx	(revision 0613e8c340f539890be23089c8b2bd9bdebc8929)
+++ frontend/src/pages/Recommendations.tsx	(revision 8f179866a26b7365968f0fff5f192672bc20d82b)
@@ -1,25 +1,17 @@
 import { useState } from "react";
 import { Subject } from "../components/types";
-import { useAuth } from "../hooks/useAuth";
+import useAxiosAuth from "../hooks/useAxiosAuth";
 
 const Recommendations = () => {
-	const { accessToken } = useAuth();
+	const axiosAuth  = useAxiosAuth();
 	const [recommendations, setRecommendations] = useState<Subject[]>([]);
 	const testAPI = async () => {
-		const start = performance.now();
-		console.log("fetching...");
-		fetch("http://localhost:8000/suggestion/", {
-			method: "GET",
-			headers: {
-				Authorization: `Bearer ${accessToken}`,
-				"Content-Type": "application/json",
-			},
-		})
-			.then((res) => res.json())
-			.then((data) => {
-				console.log(data.data);
-				setRecommendations(data.data);
-				console.log((performance.now() - start) / 1000);
-			});
+		try {
+			const response = await axiosAuth.get("/suggestion");
+			setRecommendations(response.data.data);
+		}
+		catch (error) {
+			console.error("Error fetching recommendations:", error);
+		}
 	};
 
