Refactoring code
Updating api variable name