Added status codes and error messages