I know its in the example but i would pass the api as template parameter and load it in the template. Cosmetic fix to split client and serverside code, see 

https://github.com/owncloud/apps/blob/appframework-js/news/controller/news.controller.php#L80

and 

https://github.com/owncloud/apps/blob/appframework-js/news/templates/main.php#L2

For twig templates: I got the function script('name') and style('name') in the appframework-js branch which ill merge tomorrow:

https://github.com/owncloud/apps/blob/appframework-js/appframework/dependencyinjection/dicontainer.php#L93