Add REST API to index.
Add input validation.