Refactored user attendance api at backend