encodeURIComponent was necessary to complete the API calls with code. Added it everywhere that it as needed.