bug fixing and adaptation to API 2.0 and new template