Add validations to capsule app

The PR checks for validations wrt the subdomain and api token required fields. If the required fields are present it checks for their correctness.
This method can be re-written as 
```
def validate_presence_of_required_fields
   errors = []
   error_message = nil
   errors << "API Token cannot be blank" if api_token_blank?
   errors << "Subdomain cannot be blank" if subdomain_blank?
   if errors
     error_message = errors.join(" and ")
     errors[:flash] = error_message
   end
   error_message.nil? ? true : false
end
```