} catch (PAException $e) {
         $json_string = '{ "is_error" : true, "errors" : "' . $e->message . '"}';
     }
     print $json_string;
     /**
     * Updating the list or category of links
     */
 } else {
     if (!empty($_POST) && $_POST['form_action'] == 'edit_list') {
         if (!empty($_POST['updated_category_name'])) {
             $Links = new Links();
             $Links->user_id = $_SESSION['user']['id'];
             $Links->category_name = $_POST['updated_category_name'];
             $Links->category_id = $_POST['category_id'];
             try {
                 $Links->update_category();
                 $json_string = '{ "errors" : "List has been updated successfully", "updated_category_id" : ' . $_POST['category_id'] . '}';
             } catch (PAException $e) {
                 $json_string = '{ "is_error" : true, "errors" : "List with specified name already exists"}';
             }
             print $json_string;
         }
     } else {
         if (!empty($_POST) && $_POST['form_action'] == 'create_list') {
             $json_string = null;
             if (!empty($_POST['category_name'])) {
                 $Links = new Links();
                 $Links->user_id = $_SESSION['user']['id'];
                 $Links->category_name = $_POST['category_name'];
                 try {
                     $category_id = $Links->save_category();