added indexBy method, added support for fetchAll