Added more error messages, reordered endpoints