added Database constraints, added report table query, added more documentation