GUI: Proper handling of all HTTP return codes

- Display proper error message on any http return code != 200.
  Our special cases are handled as of until now.
- Code simplification.
Merge pull request #624 from zlamalp/json

GUI: Proper handling of all HTTP return codes