API to return JSON, not markup