Matlab API integration problem (from MATLAB to Lumerical)

I’m having trouble calling Lumerical (e.g. device) from MATLAB. I have followed all the instructions listed in KB here:
And I have set the path correctly. Here is the output from matlab (I’m using MATLAB 2017b and Lumerical 2019b on MacOS Mojave 10.14.6).

!echo $PATH

Error using appopen
Unable to launch the requested application

Please use the terminal to run both MATLAB and Lumerical products.

There might be something wrong with the edited file that matlab is using when running from the launchpad.
Also make sure that from the matlab command prompt, running the path command will show the same path as !echo $PATH system command

>> !echo $PATH
>> path

Should show the path for the installation directory for the products as well as the API e.g. /API/Matlab