Session management and debug
Fixed cache check, as well as db session handling
API now returns more consistent results
Updated to reflect acls, also fixed logout redirect