API calls now work. Logging out is still bugged though.