add rest api for content categories

And this would be the return value of the index view.