Hi @ns334 , If I understand correct, your requirement is to hit the servlet only is dev or stage env and you are worrying about automaticatic execution of servlet in case of resource based servlet. You can directly put a runmode check in resource based servlet so that it will prevent futher execution.
You can follow below approaches
1. There need not be an extra API call which tells you DEV or stage env. FE can always hit actual resource based servlet and in that servlet you can put a check if it is a DEV or STAGE runmode and break the flow. I would suggest this approach because run mode control check should always be at BE so that you will be in safe side even if someone calls the servlet that shouldn't run in DEV and it will stop the execution.
2. If you don't want FE calling a servlet always and you really need a servlet which tells runmode to FE then if you have actual resource based servlet then in this case also you need to put a run mode check.
Thanks
Ramesh