Updated to work with JSON return in API v0002