Changes id to kode instead of _id
Implements api for departments