Operations done over http server should be done in the main loop context

Change-Id: Ife910d09fd6246701319b0bca75148b90bf23cfb