Fixes golint errors in pkg/api.
Merge pull request #2345 from yugui/lint/api

Fixes golint errors in pkg/api.