Address errors and warnings in CodeSniffer in api/

Change-Id: I06de371393d50eada33154626874b106d814642b
Merge "Address errors and warnings in CodeSniffer in api/"