Make Diagnostics and Sync API's optional

Change-Id: I55ddaa72b95a4b79bee644d0cc6ba8216307a3e8