diff --git a/inc/API.php b/inc/API.php
new file mode 100644
index 0000000..0d5530e
--- /dev/null
+++ b/inc/API.php
@@ -0,0 +1,104 @@
+<?php
+namespace DAFME\Covid;
+
+class API {
+  private static function returnJSON($array) {
+    echo json_encode($array);
+  }
+
+  public static function returnError($errorMessage = 'Unexpected error') {
+    http_response_code(400);
+    self::returnJson([
+      'status' => 'error',
+      'errorMessage' =>  $errorMessage
+    ]);
+  }
+
+  public static function returnPayload($payload) {
+    self::returnJson([
+      'status' => 'ok',
+      'payload' => $payload
+    ]);
+  }
+
+  public static function returnOk() {
+    self::returnJson([
+      'status' => 'ok'
+    ]);
+  }
+
+  private static function checkSignInStatus() {
+    if (!Users::isSignedIn()) {
+      self::returnError('The user hasn\'t signed in.');
+      exit();
+    }    
+  }
+
+  public static function process($path) {
+    global $conf;
+
+    header('Content-Type: application/json');
+
+    if (isset($conf['frontendUrl']) && !empty($conf['frontendUrl']))
+      header('Access-Control-Allow-Origin: '.$conf['frontendUrl']);
+
+    $parts = explode('/', $path);
+    $method = $parts[0] ?? '';
+
+    switch ($method) {
+      case 'getAuthUrl':
+        $auth = new Auth();
+        self::returnPayload([
+          'url' => $auth->getAuthUrl()
+        ]);
+        break;
+
+      case 'isSignedIn':
+        $isSignedIn = \DAFME\Covid\Users::isSignedIn();
+        self::returnPayload([
+          'signedIn' => $isSignedIn
+        ]);
+        break;
+
+      case 'signOut':
+        \DAFME\Covid\Users::signOut();
+        self::returnOk();
+        break;
+
+      case 'getAllSubjects':
+        $subjects = Subjects::getAll();
+
+        if ($subjects === false)
+          self::returnError();
+
+        self::returnPayload([
+          'subjects' => $subjects
+        ]);
+        break;
+
+      case 'getUserSubjects':
+        self::checkSignInStatus();
+        // @TODO: Implement this method
+        break;
+
+      case 'setUserSubjects':
+        self::checkSignInStatus();
+        // @TODO: Implement this method
+        break;
+
+      case 'getClasses':
+        self::checkSignInStatus();
+        // @TODO: Implement this method
+        break;
+
+      case 'setClassState':
+        self::checkSignInStatus();
+        // @TODO: Handle this method
+        break;
+
+      default:
+        self::returnError('The method requested doesn\'t exist.');
+        break;
+    }
+  }
+}
