Add method to check if HTTP status code is valid