Added handeling of non existant task lookup
If a task does not exist in the database when it is looked up
by id then the function returns a null value for the task
instead of causing a null pointer exeption trying to access it

fixes #23