fix API data

- only JSON.parse() on strings
- do not call callback() again if there is an error in callback()

reviewer: raymond