Convertible Debt and Convertible Preferred Stock - Information of convertible preferred stock (Details 3) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2016
Dec. 31, 2015
Statement of Changes in Shareholders' Equity    
Fair value of preferred stock liabilty converted to common stock $ 21,604  
Issuance of warrants for convertible notes offering 3,552  
Cash received from convertible preferred stock and warrants:    
Net proceeds received from preferred stock offering 2,346 $ (1,353)
Convertible Preferred Stock    
Statement of Changes in Shareholders' Equity    
Fair value of preferred stock liabilty converted to common stock 4,324  
Issuance of warrants for convertible notes offering 1,053  
Proceed from warrant exercise 1,570  
Statement of Operations:    
Amortization of debt discount and interest expense (304)  
Loss on debt extinguishment (2,831)  
Increase in shareholders' equity 3,812  
Cash received from convertible preferred stock and warrants:    
Preferred stock, net of costs 2,242  
Warrants, net of costs 1,570  
Net proceeds received from preferred stock offering $ 3,812