create Patterns service

this needs testing before it can be merged