more api work

1. Moved redirect code to cms.php
2. Updated the settings to let others set their own time zone.
3. Fix to the header.php in hope that it will get rid of that 500
internal error crap.
4. Forgot what else i did sorry.