before api