CDAP-538: Ported procedures of the Purchase app to services.

@ParthGandhi The Purchase app has been updated with services instead of procedures, please take a look.
Since we use this only once, better to just move the code up there instead of having a function.