Move api-class.php inclusion under plugin instance