Creating input field and reorganizing API request according to input