Implemeted almost all except the last one

Everything except nested aggregation has been done