Create REST action class that requires API keys.
Move functionality into action class.
Use media cloud REST action class for authentication.
Change the API token param from 'api' to 'key'.
Fix formating.