Handling errors for server start
Changed visibility of session, for now only access via api functions