Moved error checking from datacontroller to Database, which is more logical