Some clean up in HTTP handlers for apps