Fix API return 404 when no department is setup

When no department is setup, the return value should be empty array [],
instead of 404.