Modified checkAvailability so front and backend can call it