created conditions for api