'Returns queryset of bookmarks for GET requests.
The results will only include bookmarks for the request\'s user.
If the course_id is specified in the request parameters,
the queryset will only include bookmarks from that course.'

def get_queryset(self):

    course_id = self.request.query_params.get('course_id', None)
    if course_id:
        try:
            course_key = CourseKey.from_string(course_id)
        except InvalidKeyError:
            log.error(u'Invalid    course_id:    %s.', course_id)
            return []
    else:
        course_key = None
    return api.get_bookmarks(user=self.request.user, course_key=course_key, fields=self.fields_to_return(self.request.query_params), serialized=False)
