mapping native js objects and arrays to resources accessible via RESTful API