Stock Based Compensation - Restricted Stock and Stock Options (Details) - USD ($)
$ / shares in Units, $ in Thousands
3 Months Ended 9 Months Ended 12 Months Ended
Sep. 30, 2016
Sep. 30, 2015
Sep. 30, 2016
Sep. 30, 2015
Dec. 31, 2015
Dec. 31, 2014
Changes in unvested restricted stock            
Unvested restricted common stock, beginning of period (in shares)     1,596,853      
Vested (in shares)     (580,662)      
Unvested restricted common stock, end of period(in shares) 1,016,191   1,016,191   1,596,853  
Weighted Average Grant Date Fair Value            
Balance, beginning of period     $ 0.0188      
Vested (in dollars per share)     0.0162      
Balance, beginning of period $ 0.0203   $ 0.0203   $ 0.0188  
Compensation expense $ 3,691 $ 1,057 $ 13,099 $ 1,562    
Changes in unvested stock options            
Options exercised prior to vesting (in shares)           75,304
Options exercised prior to vesting , exercise price per share           $ 0.03
Unvested stock options (in shares) 26,301   26,301   39,338  
Outstanding, beginning of period (in shares)     1,713,385      
Granted (in shares)     1,450,441      
Exercised (in shares)     (60,357)      
Cancelled (in shares)     (12,659)      
Outstanding, end of period (in shares) 3,090,810   3,090,810   1,713,385  
Vested and expected to vest (in shares) 3,040,552   3,040,552      
Exercisable (in shares) 362,474   362,474      
Outstanding, beginning of period (in dollars per share)     $ 6.31      
Granted (in dollars per share)     21.36      
Exercised (in dollars per share)     3.47      
Cancelled (in dollars per share)     9.71      
Outstanding, end of period (in dollars per share) $ 13.41   13.41   $ 6.31  
Vested and expected to vest outstanding, weighted average exercise price (in dollars per share) 13.41   13.41      
Exercisable (in dollar per share) $ 5.20   $ 5.20      
Remaining contractual life     9 years 1 month 6 days   9 years 7 months 6 days  
Vested and expected to vest, remaining contractual life     9 years 1 month 6 days      
Exercisable, remaining contractual life     8 years 9 months 18 days      
Aggregate intrinsic value $ 11,639   $ 11,639   $ 15,580  
Vesting and expected to vest, aggregate intrinsic value 11,449   11,449      
Exercisable, aggregated intrinsic value $ 3,055   3,055      
Employees and directors            
Weighted Average Grant Date Fair Value            
Compensation expense     $ 4,000 $ 300    
Changes in unvested stock options            
Weighted average fair value of options granted (per share) $ 15.01 $ 4.71 $ 15.01 $ 4.71    
Employees            
Weighted Average Grant Date Fair Value            
Unrecognized stock-based compensation expense $ 22,800   $ 22,800      
Period for recognition     3 years      
Restricted Stock | Employees            
Weighted Average Grant Date Fair Value            
Compensation expense     $ 0 $ 0    
Unrecognized stock-based compensation expense 0   0      
Restricted Stock | Non-employees            
Weighted Average Grant Date Fair Value            
Compensation expense     7,000 $ 1,200    
Unrecognized stock-based compensation expense $ 4,100   $ 4,100      
Period for recognition     9 months 18 days