Fixed issue with SWORD error responses and moved deposit state query into separate function.