initial working version of the 2nd generation api