- Changed logic to use sessions
- Added logout file
- Moved core logic into functions in api_core.php