add input validation for stocks_api