def get_doi_endpoint_v2(doi): # the GET api endpoint (returns json data) my_pub = get_pub_from_doi(doi) return jsonify(my_pub.to_dict_v2())