fix bug when object not found

'/json/graph/:id'  and '/json/complex/:id' meets error when graph/complex with specified id not found.
This pullreq fixes it.