fixes to legislation views
simplified queries in serializer
simplified api SQL types