factor block storage out from http handling
factor out http endpoint logic into a separate file.