When the supported Moodle version allows it, place new external API code under classes/external/ with proper namespacing instead of adding new logic to legacy externallib.php. Treat externallib.php as ...