Useful code: Http JSON handeling & generic error handeling