Fixed endpoint bugs