Add a /api/node function for querying the database

Also add some comments, debugging, and change the behavior of
DB.GetNode() to only return real errors.