All functions now return error values if the operation is unsuccessful