Default APIException to code 400
Move some functions to tools module
Move service store to its own module
Implement registration of service
Implement checking state of service