commit 1865a0bed1919a9f03e2ed98cfd51bbb553cdcd3
Author: Pavel Fidransky <pavel.fidransky@yoso.fi>
Date:   Tue Jul 21 12:09:17 2020 +0200

    re #58 massive code formatting

diff --git a/client/src/App.js b/client/src/App.js
index cb57759..7620a4d 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -9,18 +9,18 @@ import YourRequests from './YourRequests';
 import Setting from './Setting';
 import LogOut from './LogOut';
 import Login from './Login';
-import { BrowserRouter, Route, Switch } from "react-router-dom";
-import * as api_fetch from './api'
+import { BrowserRouter, Route, Switch } from 'react-router-dom';
+import * as api from './api';
 
-function App() {
+export default function App() {
 
   useEffect(() => {
     if (window.location.pathname === '/login' || window.location.pathname === '/logout') return;
 
-    api_fetch.getCurrentProfile().then(currentProfile => {
+    api.getCurrentProfile().then(currentProfile => {
       setCurrentUser(currentProfile);
     }).catch(reason => {
-        alert(reason)
+      alert(reason);
     });
   }, []);
 
@@ -32,55 +32,48 @@ function App() {
       <div className="App">
         <Nav currentUser={currentUser} />
         <div className="container">
-        <Switch>
-          <Route path="/" exact component={() => <Home currentUser={currentUser} setCurrentUser={setCurrentUser}/>}/>
-          <Route path="/setting">
-            {currentUser !== undefined && currentUser.role === 'EMPLOYER'
-            ?
-              <Setting/> 
-            :
-              <div className="permissionText column">
-                <p>You don't have permission to access on this server.</p>
-              </div>
-            }
-          </Route> 
-          <Route path="/logout"><LogOut/></Route>
-          <Route path="/login"><Login/></Route>
-        </Switch>  
+          <Switch>
+            <Route path="/" exact component={() => <Home currentUser={currentUser} setCurrentUser={setCurrentUser}/>}/>
+            <Route path="/setting">
+              {currentUser !== undefined && currentUser.role === 'EMPLOYER' ? (
+                <Setting/>
+              ) : (
+                <div className="permissionText column">
+                  <p>You don&apos;t have permission to access on this server.</p>
+                </div>
+              )}
+            </Route>
+            <Route path="/logout"><LogOut/></Route>
+            <Route path="/login"><Login/></Route>
+          </Switch>
         </div>
       </div>
     </BrowserRouter>
   );
 }
 
-const Home = (props) => {
-  const [user, setUser] = useState([]);
-
+function Home(props) {
+  const [user, setUser] = useState({});
   const [acceptedRequest, setAcceptedRequest] = useState([]);
 
-  // OverviewAdmin state 
+  // OverviewAdmin state
   const [employees, setEmployees] = useState([]);
 
   return (
     <div className="container">
       <div className="main-content">
-        {props.currentUser !== undefined && props.currentUser.role === 'EMPLOYER'
-        ? 
+        {props.currentUser !== undefined && props.currentUser.role === 'EMPLOYER' ? (
           <UpcomingRequests user={user} setUser={setUser} acceptedRequest={acceptedRequest} setAcceptedRequest={setAcceptedRequest} setEmployees={setEmployees}/>
-        : 
+        ) : (
           <YourRequests user={user} setUser={setUser} acceptedRequest={acceptedRequest} setAcceptedRequest={setAcceptedRequest} currentUser={props.currentUser}/>
-        }
-        <Calendar setUser={setUser} user={user} acceptedRequest={acceptedRequest} setAcceptedRequest={setAcceptedRequest} currentUser={props.currentUser} setEmployees={setEmployees} setCurrentUser={props.setCurrentUser}/> 
+        )}
+        <Calendar setUser={setUser} user={user} acceptedRequest={acceptedRequest} setAcceptedRequest={setAcceptedRequest} currentUser={props.currentUser} setEmployees={setEmployees} setCurrentUser={props.setCurrentUser}/>
       </div>
-      {props.currentUser !== undefined && props.currentUser.role === 'EMPLOYER'
-      ?
+      {props.currentUser !== undefined && props.currentUser.role === 'EMPLOYER' ? (
         <OverviewAdmin employees={employees} setEmployees={setEmployees} />
-      :
-        <Overview currentUser={props.currentUser} employees={employees}  />
-      }
+      ) : (
+        <Overview currentUser={props.currentUser} employees={employees} />
+      )}
     </div>
-  )
-};
-
-export default App;
-
+  );
+}
diff --git a/client/src/Calendar.js b/client/src/Calendar.js
index e48bfc3..c3a1215 100644
--- a/client/src/Calendar.js
+++ b/client/src/Calendar.js
@@ -1,195 +1,185 @@
 import React, { useState, useEffect } from 'react';
 import './App.css';
-import FullCalendar from '@fullcalendar/react'
-import dayGridPlugin from '@fullcalendar/daygrid'
-import '@fullcalendar/core/main.css'
-import '@fullcalendar/daygrid/main.css'
+import FullCalendar from '@fullcalendar/react';
+import dayGridPlugin from '@fullcalendar/daygrid';
+import '@fullcalendar/core/main.css';
+import '@fullcalendar/daygrid/main.css';
 import interactionPlugin from '@fullcalendar/interaction';
-import Popup from "reactjs-popup";
+import Popup from 'reactjs-popup';
 import moment from 'moment';
-import * as api_fetch from './api'
-
-
-function Calendar(props) {
-  
-  useEffect( () => {
-    if (props.currentUser !== undefined) {
-      props.currentUser.role === 'EMPLOYER'
-        ?
-          api_fetch.getAdminCalendar().then(adminCalendar => { 
-            props.setAcceptedRequest(adminCalendar);
-          }).catch(reason => {
-            alert(reason)
-          })
-        :
-          api_fetch.getUserCalendar(props.currentUser, convertedDate).then(userCalendar => {
-            props.setAcceptedRequest(userCalendar);
-          }).catch(reason => {
-            alert(reason)
-          });
-    }
-  }, [props.currentUser]);
-
-//states
-  const [isOpen, setOpen] = useState(false)
-
-  const [whatDate, setDate] = useState('')
+import * as api from './api';
 
-  const [whatTime, setWhatTime] = useState(7.5)
+const DEFAULT_MANDAY_HOURS = 7.5;
+const SICK_DAY_COUNT_INCREMENT = 1;
 
-  const [typeRadio, setType] = useState('sickday')
+export default function Calendar(props) {
 
-  var today = new Date();
-
-// setting date to right format
-  today = today.toISOString().split('T')[0]
-  const convertedDate = today.split("-").join("/")
+  useEffect(() => {
+    if (props.currentUser === undefined) {
+      return;
+    }
 
-// ********************* ADD EVENT - EMPLOYEE **************************
+    if (props.currentUser.role === 'EMPLOYER') {
+      api.getAdminCalendar().then(adminCalendar => {
+        props.setAcceptedRequest(adminCalendar);
+      }).catch(reason => {
+        alert(reason);
+      });
+    } else {
+      api.getUserCalendar(props.currentUser, convertedDate).then(userCalendar => {
+        props.setAcceptedRequest(userCalendar);
+      }).catch(reason => {
+        alert(reason);
+      });
+    }
+  }, [props.currentUser]);
 
-const addEvent = async (e) => {
-  e.preventDefault();
-  
-  try {
-  // setting an object
-  const newDate = whatDate.split("-").join("/");
+  //states
+  const [isOpen, setOpen] = useState(false);
+  const [whatDate, setDate] = useState('');
+  const [whatTime, setWhatTime] = useState(DEFAULT_MANDAY_HOURS);
+  const [typeRadio, setType] = useState('sickday');
 
-  const dataAddEventEmployee = {
-    type: typeRadio === 'sickday' ? 'SICK_DAY' : 'VACATION',
-    date: newDate,
-    from: typeRadio === 'sickday' ? null : "00:00",
-    to: typeRadio === 'sickday' ? null : moment().startOf('day').add(whatTime, "hours").format("hh:mm"),
-  }
+  var today = new Date();
 
-  await api_fetch.addEventApi(dataAddEventEmployee);
-    if (typeRadio === 'holiday') {
-      props.setCurrentUser({
-        ...props.currentUser,
-        holiday: props.currentUser.holiday - whatTime
-      })
-    } else if (typeRadio === 'sickday') {
-      props.setCurrentUser({
-        ...props.currentUser,
-        takenSickday: props.currentUser.takenSickday + 1
-      })
+  // setting date to right format
+  today = today.toISOString().split('T')[0];
+  const convertedDate = today.split('-').join('/');
+
+  // ********************* ADD EVENT - EMPLOYEE **************************
+
+  async function addEvent(e) {
+    e.preventDefault();
+
+    try {
+      // setting an object
+      const newDate = whatDate.split('-').join('/');
+
+      const dataAddEventEmployee = {
+        type: typeRadio === 'sickday' ? 'SICK_DAY' : 'VACATION',
+        date: newDate,
+        from: typeRadio === 'sickday' ? null : '00:00',
+        to: typeRadio === 'sickday' ? null : moment().startOf('day').add(whatTime, 'hours').format('hh:mm'),
+      };
+
+      await api.addEventApi(dataAddEventEmployee);
+
+      if (typeRadio === 'holiday') {
+        props.setCurrentUser({
+          ...props.currentUser,
+          holiday: props.currentUser.holiday - whatTime,
+        });
+      } else if (typeRadio === 'sickday') {
+        props.setCurrentUser({
+          ...props.currentUser,
+          takenSickday: props.currentUser.takenSickday + SICK_DAY_COUNT_INCREMENT,
+        });
+      }
+
+      setOpen(false);
+    } catch (e) {
+      alert(e);
     }
-    
-    setOpen(false)
-  } catch (e) {
-    alert(e)
   }
-}
-// ********************* ADD EVENT ADMIN - EMPLOYER **************************
 
-const addEventAdmin = async (e) => {
-  e.preventDefault();
+  // ********************* ADD EVENT ADMIN - EMPLOYER **************************
 
-// setting an object
-  const newDate = whatDate.split("-").join("/");
+  async function addEventAdmin(e) {
+    e.preventDefault();
 
-  const dataAddEventAdmin = {
-    type: typeRadio === 'sickday' ? 'SICK_DAY' : 'VACATION',
-    date: newDate,
-    from: typeRadio === 'sickday' ? null : "00:00",
-    to: typeRadio === 'sickday' ? null : moment().startOf('day').add(whatTime, "hours").format("hh:mm"),
-  };
+    // setting an object
+    const newDate = whatDate.split('-').join('/');
 
-  api_fetch.addEventApiAdmin(dataAddEventAdmin).then(() => {
-    const userProps = {
-      title: props.currentUser.name, 
-      start: whatDate      
-  }
-  //concat new request to current ones
-      props.setAcceptedRequest((acceptedRequest) => acceptedRequest.concat(userProps))
-  }).catch(reason => {
-      alert(reason)
-  });
+    const dataAddEventAdmin = {
+      type: typeRadio === 'sickday' ? 'SICK_DAY' : 'VACATION',
+      date: newDate,
+      from: typeRadio === 'sickday' ? null : '00:00',
+      to: typeRadio === 'sickday' ? null : moment().startOf('day').add(whatTime, 'hours').format('hh:mm'),
+    };
 
-  setOpen(false)
+    api.addEventApiAdmin(dataAddEventAdmin).then(() => {
+      const userProps = {
+        title: props.currentUser.name,
+        start: whatDate,
+      };
+      //concat new request to current ones
+      props.setAcceptedRequest((acceptedRequest) => acceptedRequest.concat(userProps));
+    }).catch(reason => {
+      alert(reason);
+    });
+
+    setOpen(false);
 
-  api_fetch.getUsersOverview().then(usersOverview => {
-    props.setEmployees(usersOverview);
+    api.getUsersOverview().then(usersOverview => {
+      props.setEmployees(usersOverview);
     }).catch(reason => {
-    alert(reason)
- });
-}
+      alert(reason);
+    });
+  }
 
-  const DEFAULT_MANDAY_HOURS = 7.5;
-  
-    
   return (
     <div className="calendar">
-
-    <FullCalendar defaultView="dayGridMonth" plugins={[ dayGridPlugin, interactionPlugin ]}
-
-    dateClick={function(info) {
-      setOpen(info.dateStr > today)
-      setDate(info.dateStr)
-      setWhatTime(DEFAULT_MANDAY_HOURS)
-    }}
-    events={[
-      ...props.acceptedRequest
-  ]}
-    />
-
-    <Popup 
-    open={isOpen}
-    position="right center" 
-    modal
-    closeOnDocumentClick
-    onClose={() => setOpen(false)}
-    >
-    <div className="calendar-form">
-      <form onSubmit={props.currentUser !== undefined && props.currentUser.role === 'EMPLOYER' 
-      ? (e) => addEventAdmin(e)
-      : (e) => addEvent(e)
-      }>
-        <h2>Choose vacation type</h2>
-        <div className="calendar-radio">
-          <input checked={
-            typeRadio === 'sickday' ? 'checked' : null}
-            onChange={() => setType(typeRadio === 'holiday' ? 'sickday' : 'holiday')}
-            type="radio" id="sickday" name="radiobutton" value="sickday"
-          />
-          <label for="sickday">Sickday</label>
-        </div>
-        <div className="calendar-radio">
-          <input checked={
-            typeRadio === 'holiday' ? 'checked' : null} 
-            onChange={() => setType(typeRadio === 'holiday' ? 'sickday' : 'holiday')} 
-            type="radio" id="holiday" name="radiobutton" value="holiday"
-          />
-          <label for="holiday">Extra Holiday</label>
+      <FullCalendar
+        defaultView="dayGridMonth"
+        plugins={[dayGridPlugin, interactionPlugin]}
+        dateClick={function(info) {
+          setOpen(info.dateStr > today);
+          setDate(info.dateStr);
+          setWhatTime(DEFAULT_MANDAY_HOURS);
+        }}
+        events={[
+          ...props.acceptedRequest,
+        ]}/>
+
+      <Popup
+        open={isOpen}
+        position="right center"
+        modal
+        closeOnDocumentClick
+        onClose={() => setOpen(false)}
+      >
+        <div className="calendar-form">
+          <form onSubmit={props.currentUser !== undefined && props.currentUser.role === 'EMPLOYER' ? (e) => addEventAdmin(e) : (e) => addEvent(e)}>
+            <h2>Choose vacation type</h2>
+            <div className="calendar-radio">
+              <input checked={typeRadio === 'sickday' ? 'checked' : null}
+                onChange={() => setType(typeRadio === 'holiday' ? 'sickday' : 'holiday')}
+                type="radio" id="sickday" name="radiobutton" value="sickday"
+              />
+              <label htmlFor="sickday">Sickday</label>
+            </div>
+            <div className="calendar-radio">
+              <input checked={typeRadio === 'holiday' ? 'checked' : null}
+                onChange={() => setType(typeRadio === 'holiday' ? 'sickday' : 'holiday')}
+                type="radio" id="holiday" name="radiobutton" value="holiday"
+              />
+              <label htmlFor="holiday">Extra Holiday</label>
+            </div>
+            <div>
+              {typeRadio === 'holiday' ? <h4>Date &amp; Hours</h4> : <h4>Date</h4>}
+              <div className="row calendarInputs">
+                <input
+                  className="date-input"
+                  type='date' onChange={(e) => setDate(e.target.value)}
+                  value={whatDate} min={today}
+                />
+                {typeRadio === 'holiday' ? (
+                  <input
+                    className="input-time"
+                    step={0.5}
+                    min={0.5}
+                    max={7.5}
+                    type="number"
+                    onChange={(e) => setWhatTime(e.target.value)}
+                    required
+                    value={whatTime}/>
+                ) : null}
+              </div>
+            </div>
+            <button className="btn btn-submit" type="submit">Request vacation</button>
+          </form>
         </div>
-        <div>
-          {typeRadio === 'holiday' ? <h4>Date & Hours</h4> : <h4>Date</h4>}
-          <div className="row calendarInputs">
-            <input 
-              className="date-input" 
-              type='date' onChange={(e) => setDate(e.target.value)} 
-              value={whatDate} min={today} 
-            />
-            {typeRadio === 'holiday' ? 
-            <input
-            className="input-time"
-            step={0.5}
-            min={0.5}
-            max={7.5}
-            type="number"
-            onChange={(e) => setWhatTime(e.target.value)}
-            required
-            value={whatTime}
-          /> : null}
-             </div> 
-          </div>
-        <button className="btn btn-submit" type="submit">Request vacation</button>
-      </form>
-    </div>
-    </Popup>
-
+      </Popup>
     </div>
   );
-  }
-
-
-export default Calendar;
+}
diff --git a/client/src/HttpStatus.js b/client/src/HttpStatus.js
new file mode 100644
index 0000000..41a707c
--- /dev/null
+++ b/client/src/HttpStatus.js
@@ -0,0 +1,54 @@
+export const CONTINUE = 100;
+export const SWITCHING_PROTOCOLS = 101;
+export const PROCESSING = 102;
+export const OK = 200;
+export const CREATED = 201;
+export const ACCEPTED = 202;
+export const NON_AUTHORITATIVE_INFORMATION = 203;
+export const NO_CONTENT = 204;
+export const RESET_CONTENT = 205;
+export const PARTIAL_CONTENT = 206;
+export const MULTI_STATUS = 207;
+export const MULTIPLE_CHOICES = 300;
+export const MOVED_PERMANENTLY = 301;
+export const MOVED_TEMPORARILY = 302;
+export const SEE_OTHER = 303;
+export const NOT_MODIFIED = 304;
+export const USE_PROXY = 305;
+export const TEMPORARY_REDIRECT = 307;
+export const PERMANENT_REDIRECT = 308;
+export const BAD_REQUEST = 400;
+export const UNAUTHORIZED = 401;
+export const PAYMENT_REQUIRED = 402;
+export const FORBIDDEN = 403;
+export const NOT_FOUND = 404;
+export const METHOD_NOT_ALLOWED = 405;
+export const NOT_ACCEPTABLE = 406;
+export const PROXY_AUTHENTICATION_REQUIRED = 407;
+export const REQUEST_TIMEOUT = 408;
+export const CONFLICT = 409;
+export const GONE = 410;
+export const LENGTH_REQUIRED = 411;
+export const PRECONDITION_FAILED = 412;
+export const REQUEST_TOO_LONG = 413;
+export const REQUEST_URI_TOO_LONG = 414;
+export const UNSUPPORTED_MEDIA_TYPE = 415;
+export const REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+export const EXPECTATION_FAILED = 417;
+export const IM_A_TEAPOT = 418;
+export const INSUFFICIENT_SPACE_ON_RESOURCE = 419;
+export const METHOD_FAILURE = 420;
+export const UNPROCESSABLE_ENTITY = 422;
+export const LOCKED = 423;
+export const FAILED_DEPENDENCY = 424;
+export const PRECONDITION_REQUIRED = 428;
+export const TOO_MANY_REQUESTS = 429;
+export const REQUEST_HEADER_FIELDS_TOO_LARGE = 431;
+export const INTERNAL_SERVER_ERROR = 500;
+export const NOT_IMPLEMENTED = 501;
+export const BAD_GATEWAY = 502;
+export const SERVICE_UNAVAILABLE = 503;
+export const GATEWAY_TIMEOUT = 504;
+export const HTTP_VERSION_NOT_SUPPORTED = 505;
+export const INSUFFICIENT_STORAGE = 507;
+export const NETWORK_AUTHENTICATION_REQUIRED = 511;
\ No newline at end of file
diff --git a/client/src/LogOut.js b/client/src/LogOut.js
index a4ef9c7..72de5f9 100644
--- a/client/src/LogOut.js
+++ b/client/src/LogOut.js
@@ -2,12 +2,11 @@ import React from 'react';
 import './App.css';
 
 function LogOut() {
-
   return (
     <div className="login-container logout column">
       <p>You have been successfully logged out!</p>
     </div>
-  )
+  );
 }
 
 export default LogOut;
diff --git a/client/src/Login.js b/client/src/Login.js
index 7134e39..5a0c3ca 100644
--- a/client/src/Login.js
+++ b/client/src/Login.js
@@ -1,13 +1,10 @@
 import React from 'react';
 import './App.css';
 
-
-function Login() {
+export default function Login() {
   return (
-    <div className="login-container column">  
+    <div className="login-container column">
       <a href={window.config.baseUrl + '/login/google?target=' + window.config.redirectUrl}><p>log in</p></a>
     </div>
-  )
+  );
 }
-
-export default Login;
\ No newline at end of file
diff --git a/client/src/Nav.js b/client/src/Nav.js
index ce9279c..d07a881 100644
--- a/client/src/Nav.js
+++ b/client/src/Nav.js
@@ -1,45 +1,44 @@
 import React from 'react';
 import './App.css';
 import { Link } from 'react-router-dom';
-import * as api_fetch from './api'
+import * as api from './api';
 
-function Nav(props) {
-  return (
-    props.currentUser === undefined
-  ?
+export default function Nav(props) {
+  if (props.currentUser === undefined) {
+    return (
       <nav className="top-nav">
         <Link className="link-nav" to="/login"><h1>YOSO</h1></Link>
       </nav>
-  :
-      <nav className="top-nav">
-         <Link className="link-nav" to="/"><h1>YOSO</h1></Link>
-        <div className="profile-comp">
-        <img src={props.currentUser.photo} className="img-avatar" alt="profile_photo"></img>
-          <h2>{props.currentUser.name}</h2>
-            <ul>
-              {props.currentUser.role === 'EMPLOYER' ? 
-              <li>
-                <Link to="/setting">
-                  <svg className="bi bi-gear-fill navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
-                    <path fillRule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/>
-                  <path fillRule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/>
-                  </svg>
-                </Link>
-              </li>
-              :  null }
-              <li>
-                <button className="btn-logout" onClick={() => api_fetch.logOut()}>
-                  <svg className="bi bi-power navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
-                    <path fillRule="evenodd" d="M5.578 4.437a5 5 0 1 0 4.922.044l.5-.866a6 6 0 1 1-5.908-.053l.486.875z"/>
-                    <path fillRule="evenodd" d="M7.5 8V1h1v7h-1z"/>
-                  </svg>
-                </button>
-              </li>
-          </ul>
-        </div>
-      </nav>
-    )
-  }    
+    );
+  }
 
-
-export default Nav;
\ No newline at end of file
+  return (
+    <nav className="top-nav">
+      <Link className="link-nav" to="/"><h1>YOSO</h1></Link>
+      <div className="profile-comp">
+        <img src={props.currentUser.photo} className="img-avatar" alt="profile_photo"></img>
+        <h2>{props.currentUser.name}</h2>
+        <ul>
+          {props.currentUser.role === 'EMPLOYER' ? (
+          <li>
+            <Link to="/setting">
+              <svg className="bi bi-gear-fill navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+                <path fillRule="evenodd" d="M8.837 1.626c-.246-.835-1.428-.835-1.674 0l-.094.319A1.873 1.873 0 0 1 4.377 3.06l-.292-.16c-.764-.415-1.6.42-1.184 1.185l.159.292a1.873 1.873 0 0 1-1.115 2.692l-.319.094c-.835.246-.835 1.428 0 1.674l.319.094a1.873 1.873 0 0 1 1.115 2.693l-.16.291c-.415.764.42 1.6 1.185 1.184l.292-.159a1.873 1.873 0 0 1 2.692 1.116l.094.318c.246.835 1.428.835 1.674 0l.094-.319a1.873 1.873 0 0 1 2.693-1.115l.291.16c.764.415 1.6-.42 1.184-1.185l-.159-.291a1.873 1.873 0 0 1 1.116-2.693l.318-.094c.835-.246.835-1.428 0-1.674l-.319-.094a1.873 1.873 0 0 1-1.115-2.692l.16-.292c.415-.764-.42-1.6-1.185-1.184l-.291.159A1.873 1.873 0 0 1 8.93 1.945l-.094-.319zm-2.633-.283c.527-1.79 3.065-1.79 3.592 0l.094.319a.873.873 0 0 0 1.255.52l.292-.16c1.64-.892 3.434.901 2.54 2.541l-.159.292a.873.873 0 0 0 .52 1.255l.319.094c1.79.527 1.79 3.065 0 3.592l-.319.094a.873.873 0 0 0-.52 1.255l.16.292c.893 1.64-.902 3.434-2.541 2.54l-.292-.159a.873.873 0 0 0-1.255.52l-.094.319c-.527 1.79-3.065 1.79-3.592 0l-.094-.319a.873.873 0 0 0-1.255-.52l-.292.16c-1.64.893-3.433-.902-2.54-2.541l.159-.292a.873.873 0 0 0-.52-1.255l-.319-.094c-1.79-.527-1.79-3.065 0-3.592l.319-.094a.873.873 0 0 0 .52-1.255l-.16-.292c-.892-1.64.902-3.433 2.541-2.54l.292.159a.873.873 0 0 0 1.255-.52l.094-.319z"/>
+                <path fillRule="evenodd" d="M8 5.754a2.246 2.246 0 1 0 0 4.492 2.246 2.246 0 0 0 0-4.492zM4.754 8a3.246 3.246 0 1 1 6.492 0 3.246 3.246 0 0 1-6.492 0z"/>
+              </svg>
+            </Link>
+          </li>
+          ) : null}
+          <li>
+            <button className="btn-logout" onClick={() => api.logOut()}>
+              <svg className="bi bi-power navIcon" width="20px" height="20px" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+                <path fillRule="evenodd" d="M5.578 4.437a5 5 0 1 0 4.922.044l.5-.866a6 6 0 1 1-5.908-.053l.486.875z"/>
+                <path fillRule="evenodd" d="M7.5 8V1h1v7h-1z"/>
+              </svg>
+            </button>
+          </li>
+        </ul>
+      </div>
+    </nav>
+  );
+}
diff --git a/client/src/Overview.js b/client/src/Overview.js
index 05b69ab..d475eb7 100644
--- a/client/src/Overview.js
+++ b/client/src/Overview.js
@@ -1,38 +1,38 @@
 import React from 'react';
 import './App.css';
 
+export default function OffsAvailable(props) {
 
-const OffsAvailable = (props) => {
+  if (props.currentUser === undefined) {
+    return null;
+  }
 
-   return props.currentUser === undefined ? null : (
-      <div>
-         <div className="side-content">
-            <div className="side-board column">
-               <div className="side-board-heading row">
-                  <h3>Overview</h3>
-               </div>
-            <div className="underline-1"></div>
-            <div className="side-board-items column">
-               <table border = "0">
-                  <tbody>
-                     <tr>
-                        <th className="th-left">Name</th>
-                        <th>Sick Days</th>
-                        <th>Holiday</th>
-                     </tr>                     
-                     <tr>
-                        <td>{props.currentUser.name}</td>
-                        <td className="td-center">{props.currentUser.takenSickday + '/' + props.currentUser.sickday}</td>
-                        <td className="td-center">{props.currentUser.holiday}</td>
-                     </tr>
-                  </tbody>
-               </table>
-            </div>
-         </div>
+  return (
+    <div>
+      <div className="side-content">
+        <div className="side-board column">
+          <div className="side-board-heading row">
+            <h3>Overview</h3>
+          </div>
+          <div className="underline-1"></div>
+          <div className="side-board-items column">
+            <table border = "0">
+              <tbody>
+                <tr>
+                  <th className="th-left">Name</th>
+                  <th>Sick Days</th>
+                  <th>Holiday</th>
+                </tr>
+                <tr>
+                  <td>{props.currentUser.name}</td>
+                  <td className="td-center">{props.currentUser.takenSickday + '/' + props.currentUser.sickday}</td>
+                  <td className="td-center">{props.currentUser.holiday}</td>
+                </tr>
+              </tbody>
+            </table>
+          </div>
+        </div>
       </div>
-   </div>
-   );
+    </div>
+  );
 }
-
-
-export default OffsAvailable;
\ No newline at end of file
diff --git a/client/src/OverviewAdmin.js b/client/src/OverviewAdmin.js
index f563198..bbfb514 100644
--- a/client/src/OverviewAdmin.js
+++ b/client/src/OverviewAdmin.js
@@ -1,153 +1,147 @@
 import React, { useState, useEffect } from 'react';
 import './App.css';
-import * as api_fetch from './api'
+import * as api from './api';
 
+export default function OverviewAdmin(props) {
 
-const OverviewAdmin = (props) => {
+  useEffect(() => {
+    api.getUsersOverview().then(usersOverview => {
+      props.setEmployees(usersOverview);
+    }).catch(reason => {
+      alert(reason);
+    });
+  }, []);
 
-   useEffect(() => {
-      api_fetch.getUsersOverview().then(usersOverview => {
-         props.setEmployees(usersOverview);
-         }).catch(reason => {
-         alert(reason)
-      });
-   }, []);
+  const [isEdit, setEdit] = useState(false);
+  const [editedUserId, setEditedUserId] = useState();
+  const [prevEdit, setPrevEdit] = useState();
 
-   const [isEdit, setEdit] = useState(false);
-   const [editedUserId, setEditedUserId] = useState();
-   const [prevEdit, setPrevEdit] = useState();
-   
+  // functions
+  function changeSickdays(newValue) {
+    const newEmployees = props.employees.map(employee => {
+      if (editedUserId === employee.id) {
+        return {
+          ...employee,
+          sickday: newValue,
+        };
+      } else {
+        return employee;
+      }
+    });
+    props.setEmployees(newEmployees);
+  }
+
+  function changeHoliday(newValue) {
+    const newEmployees = props.employees.map(employee => {
+      if (editedUserId === employee.id) {
+        return {
+          ...employee,
+          holiday: newValue,
+        };
+      } else {
+        return employee;
+      }
+    });
+    props.setEmployees(newEmployees);
+  }
 
-   // functions
-   function changeSickdays(newValue) {
-      const newEmployees = props.employees.map(employee => {
-         if (editedUserId === employee.id) {
-            return {
-               ...employee,
-               sickday: newValue,
-            };
-         } else {
-            return employee
-         }
-      })
-      props.setEmployees(newEmployees);
-   }
+  async function submitEdit(e) {
+    setEdit(isEdit === true ? false : true);
+    setPrevEdit(props.employees);
+    e.preventDefault();
 
-   function changeHoliday(newValue) {
-      const newEmployees = props.employees.map(employee => {
-         if (editedUserId === employee.id) {
-            return {
-               ...employee,
-               holiday: newValue,
-            };
-         } else {
-            return employee
-         }
-      })
-      props.setEmployees(newEmployees);
-   }
+    const found = props.employees.find(employee => editedUserId === employee.id);
+    const foundPrevEdit = prevEdit.find(employee => editedUserId === employee.id);
 
-   const submitEdit = async (e) => {
-      
-      setEdit(isEdit === true ? false : true);
-      setPrevEdit(props.employees);
-      e.preventDefault();
+    const dataOverviewObject = {
+      id: found.id,
+      vacationCount: Number(found.holiday) - foundPrevEdit.holiday,
+      sickDayCount: Number(found.sickday),
+      role: found.role,
+    };
 
-      const found = props.employees.find(employee => editedUserId === employee.id);
-      const foundPrevEdit = prevEdit.find(employee => editedUserId === employee.id);
+    api.saveDataOverview(dataOverviewObject).catch(reason => {
+      alert(reason);
+    });
+  }
 
-      const dataOverviewObject = {
-         id: found.id,
-         vacationCount: Number(found.holiday) - foundPrevEdit.holiday,
-         sickDayCount: Number(found.sickday),
-         role: found.role
-      }
+  function cancel() {
+    props.setEmployees(prevEdit);
+    setEdit(false);
+  }
 
-      api_fetch.saveDataOverview(dataOverviewObject).catch(reason => {
-         alert(reason)
-       });
-   }
+  // ***** overview button ******
 
-   const cancel = () => {
-      props.setEmployees(prevEdit)
-      setEdit(false)
-   }
+  function editEmployee(employeeId, e) {
+    setEdit(true);
+    setEditedUserId(employeeId);
+    setPrevEdit(props.employees);
 
-   // ***** overview button ******
+    e.preventDefault();
+  }
 
-   const editEmployee = (employeeId, e) => {
-      setEdit(true)
-      setEditedUserId(employeeId)
-      setPrevEdit(props.employees)
-      
-     e.preventDefault();
-   }
-   
-      return (
-   <div>
+  return (
+    <div>
       <div className="side-content">
-         <div className="side-board column">
-            <form className="column side-board-items" onSubmit={(e) => submitEdit(e)}>
+        <div className="side-board column">
+          <form className="column side-board-items" onSubmit={(e) => submitEdit(e)}>
             <div className="side-board-heading row">
-               <h3>Overview</h3>
+              <h3>Overview</h3>
             </div>
             <div className="underline-1"></div>
             <div className="side-board-items column">
-               <table className="side-board-table" border = "0">
-               <tbody>
-               <tr>
-                  <th className="th-left">Name</th>
-                  <th>Sick Days</th>
-                  <th>Holiday</th>
-                  <th></th>
-               </tr>
+              <table className="side-board-table" border = "0">
+                <tbody>
+                  <tr>
+                    <th className="th-left">Name</th>
+                    <th>Sick Days</th>
+                    <th>Holiday</th>
+                    <th></th>
+                  </tr>
                   {props.employees.map(employee => (
-               <tr>
-                  <td>{employee.name}</td>
-                  {/* SickDays Input */}
-                  <td className="td-center">
-                     {isEdit === true && editedUserId === employee.id ? (
-                        <input className="offsInput" type="number" min="0" value={employee.sickday} onChange={(e) => changeSickdays(e.target.value)}/>
-                     ) : (
-                        employee.takenSickday + '/' + employee.sickday
-                     )}
-                  </td>
-                  {/* Holiday Input */}
-                  <td className="td-center">
-                     {isEdit === true && editedUserId === employee.id ? (
-                       <input className="offsInput" type="number" min="0" value={employee.holiday} onChange={(e) => changeHoliday(e.target.value)}/>
-                     ) : (
-                        employee.holiday
-                     )}</td>
-                     <td>
-                  {/* Edit Button */}
-                  <button onClick={(e) => editEmployee(employee.id, e)} className="btn-edit">
-                     <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-pencil" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
-                        <path fill-rule="evenodd" d="M11.293 1.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1 0 1.414l-9 9a1 1 0 0 1-.39.242l-3 1a1 1 0 0 1-1.266-1.265l1-3a1 1 0 0 1 .242-.391l9-9zM12 2l2 2-9 9-3 1 1-3 9-9z"/>
-                        <path fill-rule="evenodd" d="M12.146 6.354l-2.5-2.5.708-.708 2.5 2.5-.707.708zM3 10v.5a.5.5 0 0 0 .5.5H4v.5a.5.5 0 0 0 .5.5H5v.5a.5.5 0 0 0 .5.5H6v-1.5a.5.5 0 0 0-.5-.5H5v-.5a.5.5 0 0 0-.5-.5H3z"/>
-                     </svg>
-                  </button>
-                  {/* End of Edit Button */}
-                  </td>
-               </tr>
+                    <tr key={employee.id}>
+                      <td>{employee.name}</td>
+                      {/* SickDays Input */}
+                      <td className="td-center">
+                        {isEdit === true && editedUserId === employee.id ? (
+                          <input className="offsInput" type="number" min="0" value={employee.sickday} onChange={(e) => changeSickdays(e.target.value)}/>
+                        ) : (
+                          employee.takenSickday + '/' + employee.sickday
+                        )}
+                      </td>
+                      {/* Holiday Input */}
+                      <td className="td-center">
+                        {isEdit === true && editedUserId === employee.id ? (
+                          <input className="offsInput" type="number" min="0" value={employee.holiday} onChange={(e) => changeHoliday(e.target.value)}/>
+                        ) : (
+                          employee.holiday
+                        )}</td>
+                      <td>
+                        {/* Edit Button */}
+                        <button onClick={(e) => editEmployee(employee.id, e)} className="btn-edit">
+                          <svg width="1em" height="1em" viewBox="0 0 16 16" className="bi bi-pencil" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
+                            <path fillRule="evenodd" d="M11.293 1.293a1 1 0 0 1 1.414 0l2 2a1 1 0 0 1 0 1.414l-9 9a1 1 0 0 1-.39.242l-3 1a1 1 0 0 1-1.266-1.265l1-3a1 1 0 0 1 .242-.391l9-9zM12 2l2 2-9 9-3 1 1-3 9-9z"/>
+                            <path fillRule="evenodd" d="M12.146 6.354l-2.5-2.5.708-.708 2.5 2.5-.707.708zM3 10v.5a.5.5 0 0 0 .5.5H4v.5a.5.5 0 0 0 .5.5H5v.5a.5.5 0 0 0 .5.5H6v-1.5a.5.5 0 0 0-.5-.5H5v-.5a.5.5 0 0 0-.5-.5H3z"/>
+                          </svg>
+                        </button>
+                        {/* End of Edit Button */}
+                      </td>
+                    </tr>
                   ))}
-               </tbody>
-            </table>
-            {/* Submit & Reject Button */}
-            <div className="column">
-            {isEdit === true ? <button  type="submit" className="btn btn-submit">
-            Save</button> : null}
-            {isEdit === true ? (
-            <button onClick={cancel} type="submit" className="btn btn-cancel">Cancel</button>
-               ) : (null)}
-            </div> 
-          </div>
-         </form>  
+                </tbody>
+              </table>
+              {/* Submit & Reject Button */}
+              <div className="column">
+                {isEdit === true ? (
+                  <button type="submit" className="btn btn-submit">Save</button>
+                ) : (
+                  <button onClick={cancel} type="submit" className="btn btn-cancel">Cancel</button>
+                )}
+              </div>
+            </div>
+          </form>
+        </div>
       </div>
-   </div>
-   </div>
-   );    
-   }
-
-
-export default OverviewAdmin;
+    </div>
+  );
+}
diff --git a/client/src/Setting.js b/client/src/Setting.js
index 1b03836..51ddc5f 100644
--- a/client/src/Setting.js
+++ b/client/src/Setting.js
@@ -1,46 +1,44 @@
 import React, { useState, useEffect } from 'react';
 import './App.css';
 import { Link } from 'react-router-dom';
-import * as api_fetch from './api'
+import * as api from './api';
 
 
-function Setting() {
+export default function Setting() {
 
-  const [sickdays, setSickdays] = useState();
-
-  useEffect( () => {
-    api_fetch.getSettingData().then(settingData => {
+  useEffect(() => {
+    api.getSettingData().then(settingData => {
       setSetting(settingData);
     }).catch(reason => {
-      alert(reason)
-    })
+      alert(reason);
+    });
   }, []);
 
-  const submitSetting = async (e) => {
+  async function submitSetting(e) {
     e.preventDefault();
-    
+
     const dataSettingObject = {
-      "sickDayCount": Number(setting.sickday),
-      "notification": "2019/12/01 12:00:00"  
-    }
+      'sickDayCount': Number(setting.sickday),
+      'notification': '2019/12/01 12:00:00',
+    };
 
-    api_fetch.saveDataSetting(dataSettingObject).catch(reason => {
-      alert(reason)
-    })
+    api.saveDataSetting(dataSettingObject).catch(reason => {
+      alert(reason);
+    });
   }
+
   // states
-  const [setting, setSetting] = useState(
-    {sickday: 5,
-    holiday: 0
-    }
-  ) 
+  const [setting, setSetting] = useState({
+    sickday: 5,
+    holiday: 0,
+  });
 
   //functions
   function changeSickday(newValue) {
-    setSetting(
-       {sickday: newValue,
-        holiday: 0
-    })
+    setSetting({
+      sickday: newValue,
+      holiday: 0,
+    });
   }
 
   return (
@@ -60,5 +58,3 @@ function Setting() {
     </div>
   );
 }
-
-export default Setting;
\ No newline at end of file
diff --git a/client/src/UpcomingRequests.js b/client/src/UpcomingRequests.js
index 7eee49f..84659d3 100644
--- a/client/src/UpcomingRequests.js
+++ b/client/src/UpcomingRequests.js
@@ -1,84 +1,76 @@
-import React, { useState, useEffect } from 'react';
+import React, { useEffect } from 'react';
 import './App.css';
 import moment from 'moment';
-import * as api_fetch from './api'
-import convertVacationType from './convertVacationType'
+import * as api from './api';
+import convertVacationType from './convertVacationType';
 
-function UpcomingRequests(props) {
+export default function UpcomingRequests(props) {
 
-  useEffect( () => {
+  useEffect(() => {
     getData();
-  }, []);
+  }, []); // eslint-disable-line
 
   // get requests from server
-  const getData = async () => {
-   
-    api_fetch.loadAdminRequests().then((data) => {
+  async function getData() {
+    api.loadAdminRequests().then((data) => {
       props.setUser(data.map(request => {
+        const convertedStartDate = request.date.split('/').join('-');
 
-        const convertedStartDate = request.date.split("/").join("-");
-  
-        return (
-          {
-            title: request.firstName + ' ' + request.lastName,
-            id: request.id,
-            type: convertVacationType(request.type),
-            start: moment(convertedStartDate).format("D.M.YYYY"),
-            end: null,
-            status: request.status.toLowerCase()
-        })
-      }))
+        return ({
+          title: request.firstName + ' ' + request.lastName,
+          id: request.id,
+          type: convertVacationType(request.type),
+          start: moment(convertedStartDate).format('D.M.YYYY'),
+          end: null,
+          status: request.status.toLowerCase(),
+        });
+      }));
     }).catch(reason => {
-      alert(reason)
+      alert(reason);
     });
-}
-
+  }
 
   // send accepted request to server
-  const acceptRequest = async (user) => {
+  async function acceptRequest(user) {
     try {
-
       const acceptedRequests = {
         id: user.id,
         status: 'ACCEPTED',
-      }
-    
-      await api_fetch.sendAcceptedRequest(acceptedRequests).then(() => {
-        
+      };
+
+      await api.sendAcceptedRequest(acceptedRequests).then(() => {
         const userProps = {
-              title: user.title,
-              type: user.type, 
-              start: user.start
-        }
+          title: user.title,
+          type: user.type,
+          start: user.start,
+        };
         //concat new request to current ones
-          props.setAcceptedRequest((acceptedRequest) => acceptedRequest.concat(userProps))
+        props.setAcceptedRequest((acceptedRequest) => acceptedRequest.concat(userProps));
         //request accept button
-          props.setUser((pendingRequest) => pendingRequest.filter((item) => item !== user));
-      })
+        props.setUser((pendingRequest) => pendingRequest.filter((item) => item !== user));
+      });
     } catch (e) {
-      alert(e)
+      alert(e);
     }
   }
 
-
   //send rejected request to server
-  const declineRequest = async (user) => {
-    try{
-
+  async function declineRequest(user) {
+    try {
       const rejectedRequest = {
         id: user.id,
         status: 'REJECTED',
-      }
+      };
+
+      await api.sendRejectedRequest(rejectedRequest);
 
-      await api_fetch.sendRejectedRequest(rejectedRequest);
-      
-      props.setUser((acceptedRequest) => acceptedRequest.filter((item) => item !== user))
+      props.setUser((acceptedRequest) => acceptedRequest.filter((item) => item !== user));
 
-      const usersOverview = await api_fetch.getUsersOverview();
+      const usersOverview = await api.getUsersOverview();
       props.setEmployees(usersOverview);
 
-  } catch (e) {
-    alert(e)
+    } catch (e) {
+      alert(e);
     }
   }
 
@@ -89,34 +81,33 @@ function UpcomingRequests(props) {
       <div className="offs-items column">
         <div className="offs-item row">
           <table>
-          {props.user.length > 0 ?
-            <tbody>
-              <tr>
-                <th>Name</th>
-                <th>Type</th>
-                <th>Date</th>    
-              </tr>
-              {props.user.map(user => (
-              <tr>
-                <td>{user.title}</td>
-                <td>{user.type}</td>    
-                <td>{user.end ? user.start + " - " + user.end : user.start}</td>
-                <div className="offs-btn row">
-                  <button onClick={() => acceptRequest(user)} type="submit" className="btn btn-submit">Accept</button>
-                  <button onClick={() => declineRequest(user)} type="submit" className="btn btn-cancel">Decline</button>     
-              </div>
-              </tr>
-              ))}
-            </tbody>
-            :
-            <tbody>
-              <p>There are no requests.</p>
-            </tbody>}   
-            </table>
+            {props.user.length > 0 ? (
+              <tbody>
+                <tr>
+                  <th>Name</th>
+                  <th>Type</th>
+                  <th>Date</th>
+                </tr>
+                {props.user.map(user => (
+                  <tr key={user.id}>
+                    <td>{user.title}</td>
+                    <td>{user.type}</td>
+                    <td>{user.end ? user.start + ' - ' + user.end : user.start}</td>
+                    <div className="offs-btn row">
+                      <button onClick={() => acceptRequest(user)} type="submit" className="btn btn-submit">Accept</button>
+                      <button onClick={() => declineRequest(user)} type="submit" className="btn btn-cancel">Decline</button>
+                    </div>
+                  </tr>
+                ))}
+              </tbody>
+            ) : (
+              <tbody>
+                <p>There are no requests.</p>
+              </tbody>
+            )}
+          </table>
         </div>
       </div>
     </div>
-    )
-  }
-
-export default UpcomingRequests;
\ No newline at end of file
+  );
+}
diff --git a/client/src/YourRequests.js b/client/src/YourRequests.js
index 7728db5..df55d13 100644
--- a/client/src/YourRequests.js
+++ b/client/src/YourRequests.js
@@ -1,39 +1,37 @@
 import React, { useEffect } from 'react';
 import './App.css';
 import moment from 'moment';
-import * as api_fetch from './api'
-import convertVacationType from './convertVacationType'
+import * as api from './api';
+import convertVacationType from './convertVacationType';
 
-function YourRequests(props) {
+export default function YourRequests(props) {
 
   useEffect( () => {
-    if (props.currentUser !== undefined) {
-      getData();
+    if (props.currentUser === undefined) {
+      return;
     }
-  }, [props.currentUser]);
 
-  // get requests from server
-  const getData = async () => {
-
-    api_fetch.loadYourRequests(props.currentUser).then((data) => {
+    getData();
+  }, [props.currentUser]); // eslint-disable-line
 
+  // get requests from server
+  async function getData() {
+    api.loadYourRequests(props.currentUser).then((data) => {
       props.setUser(data.map(request => {
-        const convertedDate = request.date.split("/").join("-");
+        const convertedDate = request.date.split('/').join('-');
 
-      return (
-        {
+        return ({
           title: props.currentUser.name,
           id: request.id,
-          start: moment(convertedDate).format("D.M.YYYY"),
-          status: request.status = request.status.toLowerCase(),
-          type: convertVacationType(request.type)
-        }
-      )
-    }))
+          start: moment(convertedDate).format('D.M.YYYY'),
+          status: request.status.toLowerCase(),
+          type: convertVacationType(request.type),
+        });
+      }));
     }).catch(reason => {
-      alert(reason)
+      alert(reason);
     });
-}
+  }
 
   return (
     <div className="offs-request column">
@@ -42,34 +40,31 @@ function YourRequests(props) {
       <div className="offs-items column">
         <div className="offs-item row">
           <table>
-            {props.user.length > 0 ?
-            
-            <tbody>
-              <tr>
-                <th>Name</th>
-                <th>Type</th>
-                <th>Date</th>    
-                <th>Status</th>    
-              </tr>
-              {props.user.map(user => (
-                <tr key={user.id}>
-                <td>{user.title}</td>
-                <td>{user.type}</td>    
-                <td>{user.end ? user.start + " - " + user.end : user.start}</td>
-                <td>{user.status}</td>
-              </tr>
-              ))}
-            </tbody>
-            :
-            <tbody>
-              <div>No requests</div>
-            </tbody>}
+            {props.user.length > 0 ? (
+              <tbody>
+                <tr>
+                  <th>Name</th>
+                  <th>Type</th>
+                  <th>Date</th>
+                  <th>Status</th>
+                </tr>
+                {props.user.map(user => (
+                  <tr key={user.id}>
+                    <td>{user.title}</td>
+                    <td>{user.type}</td>
+                    <td>{user.end ? user.start + ' - ' + user.end : user.start}</td>
+                    <td>{user.status}</td>
+                  </tr>
+                ))}
+              </tbody>
+            ) : (
+              <tbody>
+                <div>No requests</div>
+              </tbody>
+            )}
           </table>
         </div>
       </div>
     </div>
-  )
+  );
 }
-
-
-export default YourRequests;
\ No newline at end of file
diff --git a/client/src/api.js b/client/src/api.js
index a03e567..7783f66 100644
--- a/client/src/api.js
+++ b/client/src/api.js
@@ -1,47 +1,44 @@
-// ******************** Log Out ********************
-
-export const logOut = async () => {
+import * as HttpStatus from './HttpStatus';
 
+/**
+ * Log Out
+ */
+export async function logOut() {
   let response;
 
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/logout`, {
-        credentials: 'include'
-      }
-    );    
+    response = await fetch(`${window.config.baseUrl}/logout`, {
+      credentials: 'include',
+    });
   } catch (e) {
-    throw 'Server is not available'
-    }
+    throw new Error('Server is not available');
+  }
 
   if (response.ok) {
-        window.location.replace(`/logout`)
+    window.location.replace('/logout');
   } else {
-      switch (response.status) {
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }
+    switch (response.status) {
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
 
-// ******************** GET DATA APP getCurrentProfile ********************
-
-export const getCurrentProfile = async () => {
-
+/**
+ * GET DATA APP getCurrentProfile
+ */
+export async function getCurrentProfile() {
   let response;
 
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/users/current/profile`, {
-
-        credentials: 'include'
-      }
-    );    
+    response = await fetch(`${window.config.baseUrl}/users/current/profile`, {
+      credentials: 'include',
+    });
   } catch (e) {
-    throw 'Server is not available'
-    }
+    throw new Error('Server is not available');
+  }
 
   if (response.ok) {
     const data = await response.json();
@@ -53,126 +50,127 @@ export const getCurrentProfile = async () => {
       holiday: data.vacationCount,
       sickday: data.sickDayCount,
       photo: data.photo,
-      takenSickday: data.takenSickDayCount
-    }
+      takenSickday: data.takenSickDayCount,
+    };
   } else {
-      switch (response.status) {
-        case 401:
-          window.location.replace(`/login`)
-          break;
-        case 403:
-          window.location.replace(`/login`)
-          break;
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }
+    switch (response.status) {
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
 
-// ******************** LOAD DATA to CALENDAR - EMPLOYEE ********************
-export const getUserCalendar = async (currentUser, fromDate ) => {
-
+/**
+ * LOAD DATA to CALENDAR - EMPLOYEE
+ */
+export async function getUserCalendar(currentUser, fromDate ) {
   let response;
 
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/user/${currentUser.id}/calendar?from=${fromDate}&status=ACCEPTED&status=REJECTED`, {
-        headers: {
-          'Accept': 'application/json',
-        },
-        credentials: 'include',
-        method: 'GET',
-      }
-    );
+    response = await fetch(`${window.config.baseUrl}/user/${currentUser.id}/calendar?from=${fromDate}&status=ACCEPTED&status=REJECTED`, {
+      headers: {
+        'Accept': 'application/json',
+      },
+      credentials: 'include',
+      method: 'GET',
+    });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (response.ok) {
     const data = await response.json();
-  
+
     return data.filter(day => {
-      return day.status !== 'PENDING'
+      return day.status !== 'PENDING';
     }).map(day => {
+      const newDate = day.date.split('/').join('-');
 
-    const newDate = day.date.split("/").join("-");
-
-    return ({
-      title: currentUser.name,
-      start: newDate,
-      backgroundColor: day.status === 'REJECTED' ? 'red' : 'green'
-    })
-  })
+      return ({
+        title: currentUser.name,
+        start: newDate,
+        backgroundColor: day.status === 'REJECTED' ? 'red' : 'green',
+      });
+    });
   } else {
-      switch (response.status) {
-        case 400:
-          throw new Error('Bad request. Check query parameters.')
-        case 401:
-          window.location.replace(`/login`)
-        case 403:
-          window.location.replace(`/login`)
-        case 404:
-          throw new Error('User with given ID does not exist.')
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }
+    switch (response.status) {
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.NOT_FOUND:
+        throw new Error('User with given ID does not exist.');
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
 
-// ******************** LOAD DATA to CALENDAR - EMPLOYER ********************
-
-export const getAdminCalendar = async () => {
-
+/**
+ * LOAD DATA to CALENDAR - EMPLOYER
+ */
+export async function getAdminCalendar() {
   let response;
 
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/users/requests/vacation?status=ACCEPTED`, {
-        headers: {
-          'Accept': 'application/json',
-        },
-        credentials: 'include',
-        method: 'GET',
-      }
-    );
+    response = await fetch(`${window.config.baseUrl}/users/requests/vacation?status=ACCEPTED`, {
+      headers: {
+        'Accept': 'application/json',
+      },
+      credentials: 'include',
+      method: 'GET',
+    });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (response.ok) {
     const data = await response.json();
-    
+
     return data.map(day => {
 
-      const newDate = day.date.split("/").join("-");
+      const newDate = day.date.split('/').join('-');
 
-      return ( {
-      title: day.firstName + ' ' + day.lastName,
-      start: newDate
-      })
-    })
+      return {
+        title: day.firstName + ' ' + day.lastName,
+        start: newDate,
+      };
+    });
   } else {
-      switch (response.status) {
-        case 400:
-          throw new Error('Bad request. Check query parameters.')
-        case 401:
-          window.location.replace(`/login`)
-        case 403:
-          window.location.replace(`/login`)
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }
+    switch (response.status) {
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
 
-// ******************** ADD EVENT to CALENDAR - EMPLOYEE ********************
-
+/**
+ * ADD EVENT to CALENDAR - EMPLOYEE
+ */
 export async function addEventApi(dataAddEventEmployee) {
   let response;
 
@@ -184,278 +182,289 @@ export async function addEventApi(dataAddEventEmployee) {
       },
       credentials: 'include',
       method: 'POST',
-  // object which is sent to server
-  body: JSON.stringify(dataAddEventEmployee),
+      // object which is sent to server
+      body: JSON.stringify(dataAddEventEmployee),
     });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (!response.ok) {
-      switch (response.status) {
-        case 400:
-          throw new Error('Bad request. Check request body.')
-        case 401:
-          window.location.replace(`/login`)
-        case 403:
-          window.location.replace(`/login`)
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }    
+    switch (response.status) {
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check request body.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
-      
-// ******************** ADD EVENT to CALENDAR - EMPLOYER ********************
 
+/**
+ * ADD EVENT to CALENDAR - EMPLOYER
+ */
 export async function addEventApiAdmin(dataAddEventAdmin) {
   let response;
 
   try {
-  // send accepted request to server
+    // send accepted request to server
     response = await fetch(`${window.config.baseUrl}/user/calendar/create`, {
       headers: {
         'Content-Type': 'application/json',
-    },
-    credentials: 'include',
+      },
+      credentials: 'include',
       method: 'POST',
-    // object which is sent to server
+      // object which is sent to server
       body: JSON.stringify(dataAddEventAdmin),
     });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (!response.ok) {
     switch (response.status) {
-      case 400:
-        throw new Error('Bad request. Check request body.')
-      case 401:
-        window.location.replace(`/login`)
-      case 403:
-        window.location.replace(`/login`)
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check request body.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
-    }    
+        throw new Error(response.statusText);
+    }
   }
 }
 
-// ******************** GET DATA to OVERVIEW - EMPLOYER ********************
-
-export const getUsersOverview = async () => {
+/**
+ * GET DATA to OVERVIEW - EMPLOYER
+ */
+export async function getUsersOverview() {
   let response;
 
   try {
-  response = await fetch (
-    `${window.config.baseUrl}/users`, {
+    response = await fetch (`${window.config.baseUrl}/users`, {
       credentials: 'include',
-    }
-  );
+    });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
-  
-  if (response.ok) {
 
+  if (response.ok) {
     const data = await response.json();
     return data.map(user => {
-
-     return ({
-           name: user.firstName + ' ' + user.lastName,
-           id: user.id,
-           sickday: user.sickDayCount,
-           holiday: user.vacationCount,
-           takenSickday: user.takenSickDayCount,
-           role: user.role
-        })
-    })
+      return {
+        name: user.firstName + ' ' + user.lastName,
+        id: user.id,
+        sickday: user.sickDayCount,
+        holiday: user.vacationCount,
+        takenSickday: user.takenSickDayCount,
+        role: user.role,
+      };
+    });
   } else {
     switch (response.status) {
-      case 400:
-        throw new Error('Bad request. Check query parameters.')
-      case 401:
-        window.location.replace(`/login`)
-      case 403:
-        window.location.replace(`/login`)
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
-    }    
+        throw new Error(response.statusText);
+    }
   }
 }
 
-// ******************** SAVE DATA to OVERVIEW - EMPLOYER ********************
-
+/**
+ * SAVE DATA to OVERVIEW - EMPLOYER
+ */
 export async function saveDataOverview(dataOverviewObject) {
   let response;
 
   try {
     // send accepted request to server
-        response = await fetch(`${window.config.baseUrl}/user/settings`, {
-          headers: {
-            'Content-Type': 'application/json',
-          },
-          credentials: 'include',
-          method: 'PUT',
- 
-    // object which is sent to server
-          body: JSON.stringify(dataOverviewObject),        
-        });
+    response = await fetch(`${window.config.baseUrl}/user/settings`, {
+      headers: {
+        'Content-Type': 'application/json',
+      },
+      credentials: 'include',
+      method: 'PUT',
+      // object which is sent to server
+      body: JSON.stringify(dataOverviewObject),
+    });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (!response.ok) {
     switch (response.status) {
-      case 400:
-        throw new Error('Bad request. Check query parameters.')
-      case 401:
-        window.location.replace(`/login`)
-      case 403:
-        window.location.replace(`/login`)
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
+        throw new Error(response.statusText);
     }
-  }    
+  }
 }
 
-// ******************** LOAD DATA to SETTING - EMPLOYER ********************
-export const getSettingData = async () =>  {
+/**
+ * LOAD DATA to SETTING - EMPLOYER
+ */
+export async function getSettingData() {
   let response;
 
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/settings`, {
-        credentials: 'include',
-      }
-    );
-
+    response = await fetch(`${window.config.baseUrl}/settings`, {
+      credentials: 'include',
+    });
   } catch (e) {
-    throw 'Server is not available'
-    }
+    throw new Error('Server is not available');
+  }
 
   if (response.ok) {
     const data = await response.json();
     return {
       sickday: data.sickDayCount,
-    }
+    };
   } else {
     switch (response.status) {
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
-      }            
+        throw new Error(response.statusText);
     }
-
+  }
 }
 
-// ******************** SAVE DATA to SETTING - EMPLOYER ********************
+/**
+ * SAVE DATA to SETTING - EMPLOYER
+ */
 export async function saveDataSetting(dataSettingObject) {
   let response;
 
   try {
     response = await fetch(`${window.config.baseUrl}/settings`, {
       headers: {
-        'Content-Type': 'application/json'
+        'Content-Type': 'application/json',
       },
       credentials: 'include',
       method: 'POST',
       body: JSON.stringify(dataSettingObject),
     });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (!response.ok) {
     switch (response.status) {
-      case 401:
-        window.location.replace(`/login`)
-      case 403:
-        window.location.replace(`/login`)
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
-    }    
+        throw new Error(response.statusText);
+    }
   }
 }
 
-// ****************** LOAD DATA to YOUR REQUESTS - EMPLOYEE ******************
-
+/**
+ * LOAD DATA to YOUR REQUESTS - EMPLOYEE
+ */
 export async function loadYourRequests(currentUser) {
   let response;
-  
+
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/user/${currentUser.id}/calendar?from=2020/06/24&status=PENDING`, {
-        credentials: 'include',
-      }
-    );
+    response = await fetch(`${window.config.baseUrl}/user/${currentUser.id}/calendar?from=2020/06/24&status=PENDING`, {
+      credentials: 'include',
+    });
   } catch (e) {
-    throw 'Server is not available'
+    throw new Error('Server is not available');
   }
 
   if (response.ok) {
     const data = await response.json();
     return data;
   } else {
-      switch (response.status) {
-        case 400:
-          throw new Error('Bad request. Check query parameters.')
-        case 401:
-          window.location.replace(`/login`)
-        case 403:
-          window.location.replace(`/login`)
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }    
+    switch (response.status) {
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
 
-// ****************** LOAD DATA - UPCOMING REQUESTS - EMPLOYER ****************** //tady
+/**
+ * LOAD DATA - UPCOMING REQUESTS - EMPLOYER
+ */
 export async function loadAdminRequests() {
   let response;
 
   try {
-    response = await fetch(
-      `${window.config.baseUrl}/users/requests/vacation?status=PENDING`, {
-        credentials: 'include',
-      },
-    );
+    response = await fetch(`${window.config.baseUrl}/users/requests/vacation?status=PENDING`, {
+      credentials: 'include',
+    });
   } catch (e) {
-    throw 'Server is not available'
-    } 
-  
+    throw new Error('Server is not available');
+  }
+
   if (response.ok) {
-    const data = await response.json();
-      return data;
+    return response.json();
   } else {
-      switch (response.status) {
-        case 400:
-          throw new Error('Bad request. Check query parameters.')
-        case 401:
-          window.location.replace(`/login`)
-        case 403:
-          window.location.replace(`/login`)
-        case 500:
-          throw new Error('Internal server error.')
-        default:
-          throw new Error(response.statusText)
-      }   
+    switch (response.status) {
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
+      default:
+        throw new Error(response.statusText);
     }
+  }
 }
 
-// ************** SEND ACCEPTED DATA - UPCOMING REQUESTS - EMPLOYER **************
-
+/**
+ * SEND ACCEPTED DATA - UPCOMING REQUESTS - EMPLOYER
+ */
 export async function sendAcceptedRequest(acceptedRequests) {
   let response;
 
@@ -469,32 +478,35 @@ export async function sendAcceptedRequest(acceptedRequests) {
       body: JSON.stringify(acceptedRequests),
     });
   } catch (e) {
-    throw 'Server is not available'
-    }
+    throw new Error('Server is not available');
+  }
 
   if (!response.ok) {
     switch (response.status) {
-      case 400:
-        throw new Error('Bad request. Check query parameters and request body.')
-      case 401:
-        window.location.replace(`/login`)
-      case 403:
-        window.location.replace(`/login`)
-      case 404:
-        throw new Error('Neither vacation nor authorization request with given ID exists.')
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters and request body.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.NOT_FOUND:
+        throw new Error('Neither vacation nor authorization request with given ID exists.');
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
-    }   
+        throw new Error(response.statusText);
+    }
   }
 }
 
-// ************** SEND REJECTED DATA - UPCOMING REQUESTS - EMPLOYER **************
-
+/**
+ * SEND REJECTED DATA - UPCOMING REQUESTS - EMPLOYER
+ */
 export async function sendRejectedRequest(rejectedRequest) {
   let response;
-  
+
   try {
     response = await fetch(`${window.config.baseUrl}/user/requests?type=VACATION`, {
       headers: {
@@ -505,23 +517,25 @@ export async function sendRejectedRequest(rejectedRequest) {
       body: JSON.stringify(rejectedRequest),
     });
   } catch (e) {
-    throw 'Server is not available'
-    }
-  
+    throw new Error('Server is not available');
+  }
+
   if (!response.ok) {
     switch (response.status) {
-      case 400:
-        throw new Error('Bad request. Check query parameters and request body.')
-      case 401:
-        window.location.replace(`/login`)
-      case 403:
-        window.location.replace(`/login`)
-      case 404:
-        throw new Error('Neither vacation nor authorization request with given ID exists.')
-      case 500:
-        throw new Error('Internal server error.')
+      case HttpStatus.BAD_REQUEST:
+        throw new Error('Bad request. Check query parameters and request body.');
+      case HttpStatus.UNAUTHORIZED:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.FORBIDDEN:
+        window.location.replace('/login');
+        break;
+      case HttpStatus.NOT_FOUND:
+        throw new Error('Neither vacation nor authorization request with given ID exists.');
+      case HttpStatus.INTERNAL_SERVER_ERROR:
+        throw new Error('Internal server error.');
       default:
-        throw new Error(response.statusText)
-    }    
+        throw new Error(response.statusText);
+    }
   }
 }
diff --git a/client/src/convertVacationType.js b/client/src/convertVacationType.js
index 72aaa5e..3df69d4 100644
--- a/client/src/convertVacationType.js
+++ b/client/src/convertVacationType.js
@@ -1,10 +1,10 @@
-function convertVacationType(vacationType) {
-    switch (vacationType) {
-      case 'SICK_DAY' :
-        return 'sickday';
-      default:
-        return 'holiday';
-    }
+export default function convertVacationType(vacationType) {
+  switch (vacationType) {
+    case 'SICK_DAY' :
+      return 'sickday';
+    case 'HOLIDAY':
+      return 'holiday';
+    default:
+      throw new Error(`Vacation type ${vacationType} is not supported here!`);
   }
-  
-  export default convertVacationType;
\ No newline at end of file
+}
diff --git a/client/src/index.js b/client/src/index.js
index 5c2c2a3..700a5ad 100644
--- a/client/src/index.js
+++ b/client/src/index.js
@@ -3,23 +3,29 @@ import ReactDOM from 'react-dom';
 import './index.css';
 import App from './App';
 import * as serviceWorker from './serviceWorker';
-import { render } from '@testing-library/react';
 
-fetch(
-  "config.json").then((response) => response.json()).then(config => {
+fetch('config.json')
+  .then((response) => {
+    if (response.ok) {
+      return response.json();
+    } else {
+      throw new Error('Couldn\'t fetch config.json!');
+    }
+  })
+  .then(config => {
     window.config = config;
+
     ReactDOM.render(
       <React.StrictMode>
         <App />
       </React.StrictMode>,
-      document.getElementById('root')
+      document.getElementById('root'),
     );
-    
+  })
+  .catch(reason => {
+    console.error(reason);
   });
 
-
-
-
 // If you want your app to work offline and load faster, you can change
 // unregister() to register() below. Note this comes with some pitfalls.
 // Learn more about service workers: https://bit.ly/CRA-PWA
diff --git a/client/src/serviceWorker.js b/client/src/serviceWorker.js
index b04b771..38dcc0d 100644
--- a/client/src/serviceWorker.js
+++ b/client/src/serviceWorker.js
@@ -1,3 +1,5 @@
+/* eslint-disable */
+
 // This optional code is used to register a service worker.
 // register() is not called by default.
 
