Store and resend data to server on fails

Close #75.