updated to handle OPTIONS method