I am throwing an exception now in location.course_id if category is not 'course'. Also added unit test for it.