adding functinality for api