Backend with http responses
updated functions.js