updated api and added new sql helper function