fixed some issues and bugs
used a config file to hold API key instead of a cookie