I'm not sure the solution mentioned by Edwin would work for some. There is an issue described in this thread regarding the core_course_get_courses method: https://moodle.org/mod/forum/discuss.php?d=362784
It would be ideal if there was an additional filter like "category id" for the core_course_get_courses method to prevent the web service call from timing/erroring out. However, it does not look like there has been any work for this issue.