added basic 'fetch all' function for rest
rebased my code