def post(self, device_id):

        s = Session(device_id)
        session_id = s.addSession()
        if (isinstance(session_id, int)):
            response = {}
            response['result'] = True
            response['sid'] = session_id
            return jsonify(response)
        else:
            response = {}
            response['result'] = False
            return jsonify(response)
    def post(self, session_id):

        post_data = request.get_json()
        s = Session()
        s.setid(session_id)
        s.setenergyconsumed(post_data.get('energyc'))
        r = s.updateSession()
        if (r == False):
            response = {}
            response['result'] = False
            return jsonify(response)
        else:
            response = {}
            response['result'] = True
            return jsonify(response)