Optimization of code and API initiated