def get_basic_startup(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)

    if startup_object is None:
        return jsonify({'error': 'Not found'}), HTTP_404_NOT_FOUND

    try:
        return jsonify(startup.get_basic_startup(startup_object, getUserID('me')))
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def get_details(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)
    user_id = getUserID('me')

    if startup_object is None:
        return jsonify({'error': 'Not found'}), HTTP_404_NOT_FOUND

    try:
        return jsonify(startup.get_details(startup_object, user_id))
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def update_overview(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)

    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        startup.put_overview(startup_object, request.get_json())
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def give_answer(startup_id, question_id):
    startup_object = startup.find_startup_by_id(startup_id)

    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        startup.give_answer(startup_object, question_id, request.get_json())
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def add_question(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)
    user_id = getUserID('me')

    if startup_object is None:
        return jsonify({'error': 'Not found'}), HTTP_404_NOT_FOUND

    try:
        startup.add_question(startup_object, request.get_json(), user_id)
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def remove_wall(startup_id, post_id):
    startup_object = startup.find_startup_by_id(startup_id)

    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        startup.remove_wall(startup_object, post_id, request.get_json())
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def remove_wall(startup_id, post_id):
    startup_object = startup.find_startup_by_id(startup_id)

    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        startup.remove_wall(startup_object, post_id, request.get_json())
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def post_wall(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)

    user_id = getUserID('me')
    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        return jsonify(startup.post_wall(startup_object, request.get_json(), user_id))
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def update_overview(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)

    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        startup.put_overview(startup_object, request.get_json())
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def give_answer(startup_id, question_id):
    startup_object = startup.find_startup_by_id(startup_id)

    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        startup.give_answer(startup_object, question_id, request.get_json())
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def add_question(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)
    user_id = getUserID('me')

    if startup_object is None:
        return jsonify({'error': 'Not found'}), HTTP_404_NOT_FOUND

    try:
        startup.add_question(startup_object, request.get_json(), user_id)
        return '{}'
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST
def post_wall(startup_id):
    startup_object = startup.find_startup_by_id(startup_id)

    user_id = getUserID('me')
    no = not_owned(startup_object)
    if not no is None:
        return no

    try:
        return jsonify(
            startup.post_wall(startup_object, request.get_json(), user_id))
    except Exception as e:
        return jsonify({'error': str(e)}), HTTP_400_BAD_REQUEST