First two functions for Request.js