handler working with api