Added @Transactional annotations to endpoints
Added flush call to repository