Writer was not passed to the API constructor

Change-Id: I18f597c0654f1527c82b060ce75369d9db86c01d