Lightweight api

Bring back the original pull request to my working branch