finish api auth