Redesign gate, ill to use API instead of DB