touched up some formatting issues and fixed error handling in certain endpoints