Improved documentation
Added type specs and improved documentation
Fixed typo
Fixed query functions
Added example of usage of query function