fix empty lines returning 0, add test files (api is goal, simple works at the moment)