export const CALL_API = Symbol('Call API')

@@ -10,34 +10,1039 @@
 nst 
-CALL_API = Symbol('Call API')
+BASE_URL = 'https://api.spotify.com/'%0Aexport const CALL_API = Symbol('Call API')%0A%0Aexport default function(store) %7B%0A    return next =%3E action =%3E %7B%0A        const API_ACTION = action%5BCALL_API%5D%0A%0A        if (typeof API_ACTION === 'undefined') %7B%0A            return next(action)%0A        %7D%0A%0A        const %7B endpoint, types %7D = API_ACTION%0A%0A        if (typeof endpoint !== 'string') %7B%0A            throw new Error('Specify a string endpoint URL')%0A        %7D%0A%0A        if (!Array.isArray(types) && types.length !== 3) %7B%0A            throw new Error('Expected an array of three action types')%0A        %7D%0A%0A        if (!types.every(type =%3E typeof type === 'string')) %7B%0A            throw new TypeError('Expeted action types to be strings')%0A        %7D%0A%0A        const %5B requestType, successType, failureType %5D = types%0A%0A        function actionWith(data) %7B%0A            const finalAction = Object.assign(%7B%7D, action, data)%0A            delete finalAction%5BCALL_API%5D%0A            return finalAction%0A        %7D%0A%0A        next(actionWith(%7B type: requestType %7D))%0A    %7D%0A%7D
 %0A

Add api middleware function and validations