Added: some error handling, add program/course in api, department queries