Oops, fix requests.get().json() --> request.get().json; minor clean up
Import departments before fetching courses