Refactor apirequest.js
Refactor APIRequest
Merge pull request #303 from google/refactor

Refactor API request