refactored api for gapiHandler