RESTful Resource contructor for JS