Changed query for new db structure
Change dept text to id
New department model to work with Rest