Index: trunk/BookmarkApp.pm
===================================================================
--- trunk/BookmarkApp.pm	(revision 26)
+++ trunk/BookmarkApp.pm	(revision 27)
@@ -236,9 +236,21 @@
         if ($field) {
             # respond with just the requested field as plain text
+            my $value = eval { $bookmark->$field };
+            if ($@) {
+                if ($@ =~ /Can't locate object method/) {
+                    $self->header_props(
+                        -type    => 'text/plain',
+                        -charset => 'UTF-8',
+                        -status  => 404,
+                    );
+                    return qq{"$field" is not a valid bookmark data field};
+                } else {
+                    die $@;
+                }
+            }
             $self->header_props(
                 -type    => 'text/plain',
                 -charset => 'UTF-8',
             );
-            my $value = $bookmark->{$field};
             return ref $value eq 'ARRAY' ? join(',', @{ $value }) : $value;
         } else {
@@ -248,10 +260,10 @@
                     -charset => 'UTF-8',
                 );
-                return decode_utf8(encode_json($bookmark));
+                return decode_utf8(JSON->new->utf8->convert_blessed->encode($bookmark));
             } else {
                 # display the bookmark form for this bookmark
                 $bookmark->{exists} = 1;
-                $bookmark->{created} = "Created " . localtime($bookmark->{ctime});
-                $bookmark->{created} .= '; Updated ' . localtime($bookmark->{mtime}) unless $bookmark->{ctime} == $bookmark->{mtime};
+                $bookmark->{created} = "Created " . localtime($bookmark->ctime);
+                $bookmark->{created} .= '; Updated ' . localtime($bookmark->mtime) unless $bookmark->ctime == $bookmark->mtime;
                 $self->header_props(
                     -type    => 'text/html',
