Better error handling in flight and minor format changes

Flight now returns the error string from a failed API call and copies
it to the clipboard. Minor format changes in whitespace.