<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def current_app(device_id):
 """ Get currently running app. """

    if not is_valid_device_id(device_id):
        abort(403)
    if device_id not in devices:
        abort(404)

    current = devices[device_id].current_app
    if current is None:
        abort(404)

    return jsonify(current_app=current)