Refactor API fetch method

* tighten scope of structs
* remove unnecessary pointer
* introduce pernicious returns
* remove unnecessary assert