Add rest API for search
Rewrote the pack loading to make it more flexible.