def get(self,item_id): photo = Photo.get(item_id) if photo is not None: photo.add_view() rtn = flask.make_response(json.dumps(photo.to_json())) rtn = flask.make_response(json.dumps(dict(error='photo with id:{0} was not found'.format(item_id)))) rtn.headers['Content-Type'] = 'application/json' return rtn