Returns error for some functions to be more Go-like

Signed-off-by: Jacky Boen <aqiank@gmail.com>