Changed the database error handling

Added exceptions.
Added some documentation to public functions
Removed unnecessary implementation of the function DeleteURIFrom