Created middleware to talk to frontend(locally)