CRUD working as api not as socket