addressed review comments:
- removed HTTP_DEBUG constant
- integrate API instead of several apis
- some cleanup