API Merge: Merged get functions with and without id

I think instead of having 2 different $clause variables just have only 1. The input array will change depending on if $course_id is passed. Then you can always add this one $clause variable to your $query one and use it.