Small changes.

Changed the way the db configurtion is done.
Added a link to the device/# in /device/list
Added some exception catching