<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def device_state(device_id):
 """ Get device state via HTTP GET. """

    if device_id not in devices:
        return jsonify(success=False)
    return jsonify(state=devices[device_id].state)