diff --git a/MVC.md b/MVC.md
index 5cf2080c3afcc73b9abe313ab18bc568ee817403..e9070dcd3181f65a371de147c1cd4da1966828d9 100644
--- a/MVC.md
+++ b/MVC.md
@@ -56,7 +56,7 @@ $entity = $model->where()->field(username)->equals($username)->finish();
 $entity = $model->where()->username->eq($username)->finish;
 
 ```
-For conditional selector, see utility/conditional.php@Conditional.
+For conditional selector, see framework/lib/conditional.php@Conditional.
 
 # Controllers
 To create new controller, use the namespace JLAS\Book\Controller and extends the base class BaseController. Then override the method 'run' which returns the data needed. Also use the method setResponse to set the response status of the controller.
diff --git a/assets/js/bootstrap.js b/assets/js/bootstrap.js
index d2229fdcdb05c0ad473a91387be3817a9cebe741..05253ea174e79c5cf48e64ba891de65f3043c6c1 100644
--- a/assets/js/bootstrap.js
+++ b/assets/js/bootstrap.js
@@ -2,7 +2,8 @@ var ajax = function(url, data) {
     let params = {
         method: "GET",
         cache: true,
-        data: {}
+        data: {},
+        form: false
     };
     for (var i in data) {
         params[i] = data[i];
@@ -42,11 +43,19 @@ var ajax = function(url, data) {
         xhttp.send();
     } else {
         xhttp.open(params.method, url, true);
-        if (params.data) {
-            xhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
-            xhttp.send(param);
+        if (params.form) {
+            let FD  = new FormData();
+            for (name in params.data) {
+                FD.append(name, params.data[name]);
+            }
+            xhttp.send(FD);
         } else {
-            xhttp.send(null);
+            if (params.data) {
+                xhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+                xhttp.send(param);
+            } else {
+                xhttp.send(null);
+            }
         }
     }
 }
\ No newline at end of file
diff --git a/assets/js/login.js b/assets/js/login.js
index 15204d39f9ed70dc3cbef06dac3e5083f1e2246e..cc85e1e2e29df40f58be8e7c915096a2d1d39dbf 100644
--- a/assets/js/login.js
+++ b/assets/js/login.js
@@ -8,6 +8,10 @@ window.onload = function() {
         } else {
             username_ok = false;
         }
+        if ((e.keyCode == 13) && (username_ok)) {
+            let password = document.getElementById('field_password');
+            password.focus();
+        }
     }
     password.onkeyup = function(e) {
         if (this.value !== "") {
@@ -15,6 +19,10 @@ window.onload = function() {
         } else {
             password_ok = false;
         }
+        if ((e.keyCode == 13) && (password_ok)) {
+            let button = document.getElementById('submit_button');
+            button.click();
+        }
     }
     // Whether or not a field is okay.
     var username_ok = false;
diff --git a/assets/js/register.js b/assets/js/register.js
index 7653cbac814628fcbbc3f1e7a99fb1b3dbfa67e4..659eab7f4d6fc04b34e1965b82f36066e31a9183 100644
--- a/assets/js/register.js
+++ b/assets/js/register.js
@@ -52,27 +52,18 @@ window.onload = function() {
     let password = document.getElementById('field_password');
     let r_password = document.getElementById('field_repeat_password');
     let name = document.getElementById('field_name');
-    email.onkeyup = function(e) {
-        if (this.value.match(/^\w+@\w+(\.\w+)+$/)) {
-            set_loading_state(stat_e, 3);
-            ajax("ajax/account/check_email", {
-                method: "GET",
-                data: {
-                    email: this.value
-                },
-                success: function(response) {
-                    if (response.data) {
-                        set_loading_state(stat_e, 2);
-                        email_ok = true;
-                    } else {
-                        set_loading_state(stat_e, 1, response.message);
-                        email_ok = false;
-                    }
-                }
-            });
+    let phone = document.getElementById('field_phone');
+    name.onkeyup = function(e) {
+        if (this.value !== "") {
+            set_loading_state(stat_n, 2);
+            name_ok = true;
         } else {
-            set_loading_state(stat_e, 1, "Invalid email.");
-            email_ok = false;
+            set_loading_state(stat_n, 1, "Name must not be empty.");
+            name_ok = false;
+        }
+        if ((e.keyCode == 13) && (name_ok)) {
+            let username = document.getElementById('field_username');
+            username.focus();
         }
     }
     username.onkeyup = function(e) {
@@ -97,6 +88,37 @@ window.onload = function() {
             set_loading_state(stat_u, 1, "Invalid username.");
             username_ok = false;
         }
+        if ((e.keyCode == 13) && (username_ok)) {
+            let email = document.getElementById('field_email');
+            email.focus();
+        }
+    }
+    email.onkeyup = function(e) {
+        if (validateEmail(this.value)) {
+            set_loading_state(stat_e, 3);
+            ajax("ajax/account/check_email", {
+                method: "GET",
+                data: {
+                    email: this.value
+                },
+                success: function(response) {
+                    if (response.data) {
+                        set_loading_state(stat_e, 2);
+                        email_ok = true;
+                    } else {
+                        set_loading_state(stat_e, 1, response.message);
+                        email_ok = false;
+                    }
+                }
+            });
+        } else {
+            set_loading_state(stat_e, 1, "Invalid email.");
+            email_ok = false;
+        }
+        if ((e.keyCode == 13) && (email_ok)) {
+            let password = document.getElementById('field_password');
+            password.focus();
+        }
     }
     password.onkeyup = function(e) {
         if (this.value.length < 6) {
@@ -121,6 +143,10 @@ window.onload = function() {
         } else {
             password_ok = false;
         }
+        if ((e.keyCode == 13) && (password_ok)) {
+            let r_password = document.getElementById('field_repeat_password');
+            r_password.focus();
+        }
     }
     r_password.onkeyup = function(e) {
         let password = document.getElementById('field_password');
@@ -131,14 +157,19 @@ window.onload = function() {
             set_loading_state(stat_r, 1, "Password doesn't match.");
             password_ok = false;
         }
+        if ((e.keyCode == 13) && (password_ok)) {
+            let name = document.getElementById('field_name');
+            name.focus();
+        }
+        if ((e.keyCode == 13) && (password_ok)) {
+            let address = document.getElementById('field_address');
+            address.focus();
+        }
     }
-    name.onkeyup = function(e) {
-        if (this.value !== "") {
-            set_loading_state(stat_n, 2);
-            name_ok = true;
-        } else {
-            set_loading_state(stat_n, 1, "Name must not be empty.");
-            name_ok = false;
+    phone.onkeyup = function(e) {
+        if (e.keyCode == 13) {
+            let button = document.getElementById('submit_button');
+            button.click();
         }
     }
     // Whether or not a field is okay.
@@ -149,6 +180,11 @@ window.onload = function() {
     // On submit button clicked.
     let button = document.getElementById('submit_button');
     button.addEventListener("click", (e) => {
+        let name = document.getElementById('field_name');
+        if (!name_ok) {
+            name.focus();
+            return;
+        }
         let username = document.getElementById('field_username');
         if (!username_ok) {
             username.focus();
@@ -164,11 +200,11 @@ window.onload = function() {
             password.focus();
             return;
         }
-        let name = document.getElementById('field_name');
-        if (!name_ok) {
-            name.focus();
-            return;
-        }
         document.getElementById("registration_form").submit();
     });
+}
+
+var emailRE = /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/;
+var validateEmail = function(email) {
+    return email.match(emailRE);
 }
\ No newline at end of file
diff --git a/controller/Account/LoginController.php b/controller/Account/LoginController.php
index b4306c07ad712e04846b1fc336575729687356c6..32e1b048a2a0c9de21e717a58fe66943ad1d3f9d 100644
--- a/controller/Account/LoginController.php
+++ b/controller/Account/LoginController.php
@@ -61,11 +61,11 @@ class LoginController extends BaseController {
                     return $token->asArray();
                 } else {
                     $this->setResponse(401, "Invalid username/password.");
-                    return;
+                    return $this->getArg('username');
                 }
             } else {
                 $this->setResponse(401, "Invalid username/password.");
-                return;
+                return $this->getArg('username');
             }
         }
         $this->setResponse(400);
diff --git a/controller/Image/GetImageController.php b/controller/Image/GetImageController.php
new file mode 100644
index 0000000000000000000000000000000000000000..a3d91261b09dcafe3984d4e30ff74ac666090a5c
--- /dev/null
+++ b/controller/Image/GetImageController.php
@@ -0,0 +1,31 @@
+<?php
+namespace JLAS\Book\Controller\Image;
+use \JLAS\Book\Controller\BaseController;
+use \JLAS\Book\Model as Model;
+use \JLAS\Book\Entity as Entity;
+
+class GetImageController extends BaseController {
+
+    /**
+     * Get the data needed for this controller.
+     * @return array data passed to the view.
+     */
+    protected function run($params) {
+        if ($this->useArgs('id')) {
+            $model_image = new Model\ImageModel();
+            $image = $model_image->findByID($this->getArg('id'));
+            if (isset($image)) {
+                $this->setResponse(200);
+                return $image->asArray();
+            } else {
+                $this->setResponse(400, "Invalid image id");
+                return null;
+            }
+        }
+        $this->setResponse(400);
+        return null;
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/controller/Image/SetImageController.php b/controller/Image/SetImageController.php
new file mode 100644
index 0000000000000000000000000000000000000000..9e310033cd1102e30f31db677a0f45bd549e18ed
--- /dev/null
+++ b/controller/Image/SetImageController.php
@@ -0,0 +1,31 @@
+<?php
+namespace JLAS\Book\Controller\Image;
+use \JLAS\Book\Controller\BaseController;
+use \JLAS\Book\Model as Model;
+use \JLAS\Book\Entity as Entity;
+
+class SetImageController extends BaseController {
+
+    /**
+     * Get the data needed for this controller.
+     * @return array data passed to the view.
+     */
+    protected function run($params) {
+        if ((isset($_FILES['data'])) && $this->useArgs("type")) {
+            $file = file_get_contents($_FILES['data']["tmp_name"]);
+            $model_image = new Model\ImageModel();
+            $image = new Entity\ImageEntity(array(
+                "id" => 0,
+                "data" => $file,
+                "type" => $this->getArg('type')
+            ));
+            $model_image->create($image);
+            $this->setResponse(200);
+            return $image->id;
+        }
+        $this->setResponse(400);
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/controller/TestController.php b/controller/TestController.php
deleted file mode 100644
index 5d4f1f416d2f04d11adef89ea186713aca7f31d5..0000000000000000000000000000000000000000
--- a/controller/TestController.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php 
-namespace JLAS\Book\Controller;
-use JLAS\Book\Model;
-use Exception;
-
-class TestController extends BaseController {
-
-    /**
-     * Get the data needed for this controller.
-     * @return array data passed to the view.
-     */
-    protected function run($params) {
-        $model = new Model\AccountModel();
-        $res = $model->all();
-        return $res;
-    }
-
-}
-
-?>
\ No newline at end of file
diff --git a/entity/ImageEntity.php b/entity/ImageEntity.php
new file mode 100644
index 0000000000000000000000000000000000000000..17138e50fb3e5f385b4d19fb128cf9de25b67c14
--- /dev/null
+++ b/entity/ImageEntity.php
@@ -0,0 +1,44 @@
+<?php
+namespace JLAS\Book\Entity;
+
+class ImageEntity extends BaseEntity {
+
+    /**
+     * ID of the image.
+     */
+    public $id;
+
+    /**
+     * Data of the image.
+     */
+    public $data;
+
+    /**
+     * Type of the image.
+     */
+    public $type;
+
+    /**
+     * Load this entity from an associative array.
+     * @param $data data in which the entity is loaded from.
+     */
+    public function load($data) {
+        $this->id = BaseEntity::get($data, "id");
+        $this->data = BaseEntity::get($data, "data");
+        $this->type = BaseEntity::get($data, "type");
+    }
+
+    /**
+     * Returns entity as associative array.
+     * @return array
+     */
+    public function asArray() {
+        return array(
+            "id" => $this->id,
+            "data" => $this->data,
+            "type" => $this->type,
+        );
+    }
+}
+
+?>
\ No newline at end of file
diff --git a/framework/lib/conditional.php b/framework/lib/conditional.php
index cb93163402bd73e37fd8238353e69c9452408703..5d3b26e488cbce272d8f636fc5ca02667e60ae67 100644
--- a/framework/lib/conditional.php
+++ b/framework/lib/conditional.php
@@ -148,8 +148,9 @@ class Conditional {
         return $this->field($name);
     }
 
-    public function __construct($executor=null) {
+    public function __construct($executor=null, $exec_method=null) {
         $this->executor = $executor;
+        $this->exec_method = $exec_method;
     }
 
     public function field($name) {
@@ -245,8 +246,8 @@ class Conditional {
     }
 
     public function finish() {
-        if (isset($this->executor)) {
-            return $this->executor->exec($this);
+        if (isset($this->executor, $this->exec_method)) {
+            return call_user_func(array($this->executor, $this->exec_method), $this);
         } else {
             throw new ConditionalError("No executor to run");
         }
diff --git a/framework/lib/router.php b/framework/lib/router.php
index bb714d036eddb5ed41e5c325eef9fed175ecb581..9f89dd238db5e7575a2c7ab58d231a1c0ca97977 100644
--- a/framework/lib/router.php
+++ b/framework/lib/router.php
@@ -5,6 +5,18 @@
  */
 namespace SuPHP\Routing;
 $routes = [];
+$redirects = [];
+
+function addRedirect($regex_path, $method, $target) {
+    if (isset($GLOBALS['redirects'])) {
+        if (!isset($GLOBALS['redirects'][$regex_path])) {
+            $GLOBALS['redirects'][$regex_path] = array();
+        }
+        $GLOBALS['redirects'][$regex_path][$method] = $target;
+        return true;
+    }
+    return false;
+}
 
 function addRoute($regex_path, $method, $views, $controller=null) {
     if (isset($GLOBALS['routes'])) {
@@ -28,6 +40,17 @@ function addRoute($regex_path, $method, $views, $controller=null) {
  */
 function findRoute($method, $path) {
     $route = null;
+    if (isset($GLOBALS['redirects'])) {
+        $redirects = $GLOBALS['redirects'];
+        foreach ($redirects as $key => $val) {
+            if (preg_match('/' . $key . '/', $path)) {
+                if (isset($val[$method])) {
+                    $route = array('redirects' => $val[$method]);
+                    break;
+                }
+            }
+        }
+    }
     if (isset($GLOBALS['routes'])) {
         $routes = $GLOBALS['routes'];
         foreach ($routes as $key => $val) {
diff --git a/framework/su.php b/framework/su.php
index a206e7d2d1dce4dea77cf02b9716a6b2e52486ed..6c5aa4b68472049821c37fc9a11006eb82936b0e 100644
--- a/framework/su.php
+++ b/framework/su.php
@@ -44,7 +44,7 @@ function start() {
     $path = substr(parse_url($request, PHP_URL_PATH), strlen(SUBFOLDER));
     // Find the route for current request.
     $routing = Routing\findRoute($method, $path);
-    if (isset($routing)) {
+    if (isset($routing['views'])) {
         try {
             // Get the data to be passed to the controller based on the request method.
             $data = null;
@@ -86,6 +86,8 @@ function start() {
         } catch (Throwable $e) {
             include VIEW . "exception.php";
         }
+    } else if (isset($routing['redirects'])) {
+        redirect($routing['redirects']);
     } else {
         // Routing not found.
         http_response_code(404);
diff --git a/index.php b/index.php
index ff0ab7247a75cc2bf18aaf5ac92c335c9682397f..8a86cc2ba899435357924104796425794ebae502 100644
--- a/index.php
+++ b/index.php
@@ -1,11 +1,11 @@
 <?php
 namespace JLAS\Book;
-use JLAS\Book\Controller as Controller;
 define('ROOT', __DIR__ . '/');
+define('ROUTING', __DIR__ . '/routing/');
 require_once "framework/su.php";
 
 // Load all routing.
-foreach (glob("routing/*.php") as $filename) {
+foreach (glob(ROUTING . "*.php") as $filename) {
     include $filename;
 }
 
diff --git a/model/BaseModel.php b/model/BaseModel.php
index edd98da232cd5b3850c10bbe0e9986b6493a0812..d417242d348282910b37e40d59a3aff03d3b09a9 100644
--- a/model/BaseModel.php
+++ b/model/BaseModel.php
@@ -123,7 +123,7 @@ abstract class BaseModel {
     public function where($limit=null, $offset=null) {
         $this->limit = $limit;
         $this->offset = $offset;
-        return new Conditional($this);
+        return new Conditional($this, 'exec');
     }
 
     /**
diff --git a/model/ImageModel.php b/model/ImageModel.php
new file mode 100644
index 0000000000000000000000000000000000000000..f5e6fa38790a77e67eb7a48bd1a8f9cd297bad36
--- /dev/null
+++ b/model/ImageModel.php
@@ -0,0 +1,95 @@
+<?php
+namespace JLAS\Book\Model;
+
+class ImageModel extends BaseModel {
+
+    function __construct() {
+        parent::__construct("ImageEntity");
+        $this->table = "images";
+    }
+
+    /**
+     * Find an image with specific id.
+     * @param string $id The id of the image.
+     * @return ImageEntity the entity with matching id.
+     */
+    public function findByID($id) {
+        $result = $this->query("SELECT * FROM $this->table WHERE `id` = :id LIMIT 1", array(":id"=>$id));
+        if (count($this->queryResult) > 0) {
+            return $this->newEntity($this->queryResult[0]);
+        }
+        return null;
+    }
+    
+    /**
+     * Find an entity matching the criteria.
+     * @return array an array containing all matching entities.
+     */
+    public function find($criteria, $data) {
+        $result = $this->query("SELECT * FROM $this->table WHERE $criteria", $data);
+        $retval = array();
+        if ($result) {
+            foreach ($this->queryResult as $row) {
+                array_push($retval, $this->newEntity($row));
+            }
+        }
+        return $retval;
+    }
+
+    /**
+     * Insert a new entity into the database.
+     * @param ImageEntity $entity the entity to be created.
+     * @return boolean if the creation is successful.
+     */
+    public function create($entity) {
+        if ($this->findByID($entity->id) != null) {
+            return false;
+        }
+        $result = $this->query(
+            "INSERT INTO $this->table (`id`, `data`, `type`) VALUES (:id, :data, :type)",
+            array(
+                ":id" => $entity->id,
+                ":data" => $entity->data,
+                ":type" => $entity->type,
+            )
+        );
+        $entity->id = $this->connect()->lastInsertId();
+        return $result;
+    }
+
+    /**
+     * Update an entity in the database.
+     * @param ImageEntity $entity the entity to be updated.
+     * @return boolean if the update is successful.
+     */
+    public function update($entity) {
+        $result = $this->query(
+            "UPDATE $this->table SET `id`=:id, `data`=:data, `type`=:type",
+            array(
+                ":id" => $entity->id,
+                ":data" => $entity->data,
+                ":type" => $entity->type,
+            )
+        );
+        return $result;
+    }
+
+    /**
+     * Delete an entity from the database.
+     * @param ImageEntity $entity the entity to be deleted.
+     * @return boolean if the deletion is successful.
+     */
+    public function delete($entity) {
+        $result = $this->query(
+            "DELETE FROM $this->table WHERE `id`=:id",
+            array(
+                ":id" => $entity->id,
+            )
+        );
+        return $result;
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/routing/default.php b/routing/default.php
index 39ed09ddd60e2183e537b1dd914a009afe93b09b..88f1d96cdca4b92dee9c1b3a0b51a355e13c6b6e 100644
--- a/routing/default.php
+++ b/routing/default.php
@@ -2,14 +2,6 @@
 namespace JLAS\Book;
 use SuPHP\Routing as Routing;
 
-Routing\addRoute("^tes$", "GET", ["json.php"], "TestController");
-Routing\addRoute("^login$", "GET", ["login.php"], "Account\LoginCheckController");
-Routing\addRoute("^login$", "POST", ["login.php"], "Account\LoginController");
-Routing\addRoute("^logout$", "GET", ["logout.php"], "Account\LogoutController");
-Routing\addRoute("^register$", "GET", ["register.php"]);
-Routing\addRoute("^register$", "POST", ["register.php"], "Account\RegisterController");
-Routing\addRoute("^ajax\/account\/check_username$", "GET", ["json.php"], "Account\CheckUsernameController");
-Routing\addRoute("^ajax\/account\/check_email", "GET", ["json.php"], "Account\CheckEmailController");
-
+Routing\addRedirect("^$", "GET", "login");
 
 ?>
\ No newline at end of file
diff --git a/routing/images.php b/routing/images.php
new file mode 100644
index 0000000000000000000000000000000000000000..b5ba33695d1705ef4856a5a620268f8201443f0b
--- /dev/null
+++ b/routing/images.php
@@ -0,0 +1,9 @@
+<?php 
+namespace JLAS\Book;
+use SuPHP\Routing as Routing;
+
+Routing\addRoute("^ajax\/image\/get$", "GET", ["image.php"], "Image\GetImageController");
+Routing\addRoute("^ajax\/image\/set$", "POST", ["json.php"], "Image\SetImageController");
+
+
+?>
\ No newline at end of file
diff --git a/routing/register.php b/routing/register.php
new file mode 100644
index 0000000000000000000000000000000000000000..87e02156e01bfc26f57aba165438885cdbf719e1
--- /dev/null
+++ b/routing/register.php
@@ -0,0 +1,14 @@
+<?php 
+namespace JLAS\Book;
+use SuPHP\Routing as Routing;
+
+Routing\addRoute("^login$", "GET", ["login.php"], "Account\LoginCheckController");
+Routing\addRoute("^login$", "POST", ["login.php"], "Account\LoginController");
+Routing\addRoute("^logout$", "GET", ["logout.php"], "Account\LogoutController");
+Routing\addRoute("^register$", "GET", ["register.php"]);
+Routing\addRoute("^register$", "POST", ["register.php"], "Account\RegisterController");
+Routing\addRoute("^ajax\/account\/check_username$", "GET", ["json.php"], "Account\CheckUsernameController");
+Routing\addRoute("^ajax\/account\/check_email", "GET", ["json.php"], "Account\CheckEmailController");
+
+
+?>
\ No newline at end of file
diff --git a/sql/images.sql b/sql/images.sql
new file mode 100644
index 0000000000000000000000000000000000000000..d4ccea6f76e6da7c29a3d8e336676e0f005b5a50
--- /dev/null
+++ b/sql/images.sql
@@ -0,0 +1,61 @@
+-- phpMyAdmin SQL Dump
+-- version 4.8.0
+-- https://www.phpmyadmin.net/
+--
+-- Host: localhost
+-- Generation Time: Oct 23, 2018 at 09:13 AM
+-- Server version: 10.1.31-MariaDB
+-- PHP Version: 7.2.4
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET AUTOCOMMIT = 0;
+START TRANSACTION;
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8mb4 */;
+
+--
+-- Database: `book`
+--
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `images`
+--
+
+DROP TABLE IF EXISTS `images`;
+CREATE TABLE `images` (
+  `id` int(11) NOT NULL,
+  `data` longblob NOT NULL,
+  `type` varchar(255) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Indexes for dumped tables
+--
+
+--
+-- Indexes for table `images`
+--
+ALTER TABLE `images`
+  ADD PRIMARY KEY (`id`);
+
+--
+-- AUTO_INCREMENT for dumped tables
+--
+
+--
+-- AUTO_INCREMENT for table `images`
+--
+ALTER TABLE `images`
+  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
+COMMIT;
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
diff --git a/view/image.php b/view/image.php
new file mode 100644
index 0000000000000000000000000000000000000000..0cc0ffcd065ed609c0de5f618ea21739118bae25
--- /dev/null
+++ b/view/image.php
@@ -0,0 +1,16 @@
+<?php
+if ($response['code'] == 200) {
+    $mime = "";
+    if ($data['type'] == "png") {
+        $mime = "image/png";
+    } else if ($data['type'] == "jpg") {
+        $mime = "image/jpeg";
+    } else if ($data['type'] == "gif") {
+        $mime = "image/gif";
+    }
+    header("Content-Type: $mime");
+    echo $data['data'];
+} else {
+    echo "nothing";
+}
+?>
\ No newline at end of file
diff --git a/view/login.php b/view/login.php
index 1b69af8971fa19f9f1f058c0331a9bbda5172062..ebbcbb7894fdef793bb5d47725ef97083359c29e 100644
--- a/view/login.php
+++ b/view/login.php
@@ -4,7 +4,7 @@
         if (isset($response)) {
             if ($response["code"] == 200) {
                 if ($data) {
-                    redirect("index");
+                    redirect("browse");
                 }
             }
         }
@@ -12,9 +12,10 @@
         if (isset($response)) {
             if ($response["code"] == 200) {
                 setcookie('access-token', $data['access-token'], time() + 3600 * 24, '/');
-                redirect("index");
+                redirect("browse");
             } else {
                 alert($response['message']);
+                $username = $data;
             }
         }
     }
@@ -42,11 +43,11 @@
                 <form method="POST" action="" id="login_form">
                     <tr>
                         <td><label>Username</label></td>
-                        <td><input id="field_username" type="text" name="username"/></td>
+                        <td><input id="field_username" type="text" name="username" value="<?php if (isset($username)) { echo $username; } ?>"/></td>
                     </tr>
                     <tr>
                         <td><label>Password</label></td>
-                        <td><input id="field_password" type="password" name="password"/></td>
+                        <td><input id="field_password" type="password" name="password" <?php if (isset($username)) { echo "autofocus";} ?>/></td>
                     </tr>
                 </form>
                 <tr>
diff --git a/view/register.php b/view/register.php
index 38af4ca69449e1d8ce028ee1b0fa80986ba30423..5c5be384cb3df789895242223ae9ba111583a609 100644
--- a/view/register.php
+++ b/view/register.php
@@ -6,7 +6,7 @@
     if (isset($response)) {
         if ($response['code'] == 200) {
             echo "<script type=\"text/javascript\">alert(\"Account created\");</script>";
-            redirect('index');
+            redirect('browse');
         } else if ($response['code'] != 500) {
             echo "<script type=\"text/javascript\">alert(\"{$response['message']}\");</script>";
         }
@@ -36,7 +36,7 @@
                 <form method="POST" action="" id="registration_form">
                     <tr>
                         <td><label>Name</label></td>
-                        <td><input id="field_name" type="text" name="name"/></td>
+                        <td><input id="field_name" type="text" name="name" autofocus/></td>
                         <td class="status-icon" id="status_name"><span></span></td>
                     </tr>
                     <tr>