provide a JavaScript API rather a REST API