Make http fetch function work