DataAccesslayer and database models

Tested, so the 4 functions should be safe to use