Moved more things into the core, and made it so the api checks if the user is logged in