Implemented LoadingState and fixed some stuff