public static function list_user_plans($userid) {
        global $PAGE;
        $params = self::validate_parameters(self::list_user_plans_parameters(), array(
            'userid' => $userid
        ));

        $context = context_user::instance($params['userid']);
        self::validate_context($context);
        $output = $PAGE->get_renderer('core');

        $response = array();
        $plans = api::list_user_plans($params['userid']);
        foreach ($plans as $plan) {
            $exporter = new plan_exporter($plan, array('template' => $plan->get_template()));
            $response[] = $exporter->export($output);
        }

        return $response;
    }