src: Update source code to use new API and fix compilation errors due to missing headers

Change-Id: I295fbcdcd6ab114a565d9b7531387728a6596884
Refs: 1629