Use ruby helper
Add spec tests and fix head request