def album(id): r = AppleRequest() try: data_json = r.album(id) except ItunesGetProblemException: return resp_500('Connection itunes problem on get list songs') except: return resp_500('Internal Error on list songs') try: s_arr = json.loads(data_json) except: return resp_500('Internal Error on list songs on parse json') if (s_arr['resultCount'] == 0): resp_404('Songs not found') return resp_ok(data_json)