Changed the way of returning values from low-level api.

Low-level function like open-connection, etc, in case
of error will cause condition instead return nil.