Fixed API to return id