input: Refactoring API (#121)

close #121