Bug fixes.

Updated all API calls with ServerDownException.
Updated the error code for 504.