Mainly checks for permissions and gets information from the database