Added functionality for supporting 504 Timeout errors ; refined 404 for external services