open/close rest loop (+ alot minor fixes)
Merge pull request #42 from seavor/jay

open/close rest loop (+ alot minor fixes)