Create get task function
Now gets tasks