def update(self, id):
        """PUT /layertemplates/id: Update an existing item."""
        # url('LayerTemplates', id=ID)
        lt = meta.Session.query(LayerTemplate).get(id)
        # use following query for getting a layertemplate owned by current user
        #lt = self._get_lt_from_user_by_id(c.user, id)
        if lt is None:
            abort(404)
        content = request.environ['wsgi.input'].read(int(request.environ['CONTENT_LENGTH']))
        content = content.decode('utf8')
        content = simplejson.loads(content)        
        lt.name = content['name']
        lt.comment = content['comment']
        lt.json = content['json']
        meta.Session.commit()
        response.status = 201