Fix sql limit api in fetching results