Mogadishu has managed to retake most territory from the armed group al-Shabab, but it continues to suffer from frequent deadly attacks.