Using JSON for API requests