first working version with few API methods