Fixed import book function
Added some tests for better coverage