refactored to two post requests for leave and join