Refactored API to be compatible with Yun port